/*
 * @(#)GSManufactureDAO.java
 * 
 * Project: BUS
 *  
 *  Modify Information:
 *  =========================================================================
 *  Change History:
 *  Author     Date       Description
 *  ==========  ============== ===================================================
 *  simon yi       2006-02-07 
 *  Tuthmos Liu    2008-06-03   增加产品查询方法
 *  Tuthmos Liu    2008-06-13   修改图件号记录��������
 * 
 * Copyright Notice: Copyright (c) 2001-2005 Beijing HiTRUST Technology Co.,
 * Ltd. 1808 Room, Science & Technology Building, No. 9 South Street, Zhong Guan
 * Cun, Haidian District, Beijing ,100081, China All rights reserved.
 * 
 * This software is the confidential and proprietary information of HiTRUST.COM,
 * Inc. ('Confidential Information'). You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with HiTRUST.
 * 
 * Warning:
 * =========================================================================
 * 
 */
package com.hitrust.gs.dao;


import java.sql.Connection;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import com.apep.lib.xml.SampleElement;
import com.hitrust.gs.bean.GSManufactureBean;
import com.hitrust.gs.bean.GSManufactureCategoryBean;
import com.hitrust.gs.bean.GSManufactureSyncBean;
import com.hitrust.gs.bean.GSOrderDetailSignIn;
import com.hitrust.gs.bean.GSProductPicture;
import com.hitrust.gs.bean.GSProductStorageCount;
import com.hitrust.gs.bean.GSProductSynConfigBean;
import com.hitrust.gs.bean.GSProductTemporaryBean;
import com.hitrust.gs.bean.GSProductTemporaryMaintainBean;
import com.hitrust.gs.bean.GSProductUpdateIsbuyBean;
import com.hitrust.gs.bean.GSProductUpdatePriceBean;
import com.hitrust.gs.bean.GSProviderBean;
import com.hitrust.gs.bean.GSUserMenuInfoBean;
import com.hitrust.gs.business.GSManufactureProcessor;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.lib.db.GSBaseDAO;
import com.hitrust.gs.util.DefineDic;
import com.hitrust.gs.util.exception.GSException;
import com.hitrust.gs.util.lang.StringUtils;
import com.hitrust.gs.vo.GSManufactureVO;
import java.sql.PreparedStatement;

/**
 * @author simonyi
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class GSManufactureDAO extends GSBaseDAO
{
    
String insertSql = "insert into t_product (" +
"apep_code," +
"concentricity_code," +
"name," +
"category_code,"+
"product_brand," +
"model," +
"spec," +
"unit_price," +
"product_unit,"+
"quality_assure_period," +
"manufaturer," +
"area," +
"provider_code," +
"adapt_machine_type," +
"recorder_id,"+
"record_date," +
"is_tradeflat_product," +
"appender_property," +
"remark," +
"status,"+
"drawing_piece_code," +
"is_buy," +
"balance_mode," +
"create_user_id,"+
"create_user,"+
"create_time,"+
"last_update_user_id,"+
"last_update_user,"+
"last_update_time,"+
"balance_customer_code,"+
"pic,"+
"recent_adjustprice_date,"+
"recent_adjusted_price,"+
"is_normal,"+
"warehouse_code,"+
"warehouse_name, is_update,plan_price,id"+
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";

String insertProductSql = "insert into t_product (" +
"apep_code," +
"concentricity_code," +
"name," +
"category_code,"+
"product_brand," +
"model," +
"spec," +
"unit_price," +
"product_unit,"+
"quality_assure_period," +
"manufaturer," +
"area," +
"provider_code," +
"adapt_machine_type," +
"recorder_id,"+
"record_date," +
"is_tradeflat_product," +
"appender_property," +
"remark," +
"status,"+
"drawing_piece_code," +
"is_buy," +
"balance_mode," +
"create_user_id,"+
"create_user,"+
"create_time,"+
"last_update_user_id,"+
"last_update_user,"+
"last_update_time,"+
"balance_customer_code,"+
"pic,"+
"recent_adjustprice_date,"+
"recent_adjusted_price,"+
"is_normal,"+
"warehouse_code,"+
"warehouse_name, is_update, plan_price, id"+
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";

String insertKMSql = "insert into t_product (" +
"apep_code," +
"concentricity_code," +
"name," +
"category_code,"+
"product_brand," +
"model," +
"spec," +
"unit_price," +
"product_unit,"+
"quality_assure_period," +
"manufaturer," +
"area," +
"provider_code," +
"adapt_machine_type," +
"recorder_id,"+
"record_date," +
"is_tradeflat_product," +
"appender_property," +
"remark," +
"status,"+
"drawing_piece_code," +
"is_buy," +
"balance_mode," +
"create_user_id,"+
"create_user,"+
"create_time,"+
"last_update_user_id,"+
"last_update_user,"+
"last_update_time,"+
"balance_customer_code,"+
"pic,"+
"recent_adjustprice_date,"+
"recent_adjusted_price,"+
"is_normal,"+
"warehouse_code,"+
"warehouse_name, is_update,plan_price,km_quality_assure_period,id"+
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";

String insertProductKMSql = "insert into t_product (" +
"apep_code," +
"concentricity_code," +
"name," +
"category_code,"+
"product_brand," +
"model," +
"spec," +
"unit_price," +
"product_unit,"+
"quality_assure_period," +
"manufaturer," +
"area," +
"provider_code," +
"adapt_machine_type," +
"recorder_id,"+
"record_date," +
"is_tradeflat_product," +
"appender_property," +
"remark," +
"status,"+
"drawing_piece_code," +
"is_buy," +
"balance_mode," +
"create_user_id,"+
"create_user,"+
"create_time,"+
"last_update_user_id,"+
"last_update_user,"+
"last_update_time,"+
"balance_customer_code,"+
"pic,"+
"recent_adjustprice_date,"+
"recent_adjusted_price,"+
"is_normal,"+
"warehouse_code,"+
"warehouse_name, is_update, plan_price,km_quality_assure_period,id"+
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";

String updateProductSql = "update t_product set " +
"apep_code = ?," +
"concentricity_code=?," +
"name=?," +
"category_code=?,"+
"product_brand=?," +
"model=?," +
"spec=?," +
"unit_price=?," +
"product_unit=?,"+
"quality_assure_period=?," +
"manufaturer=?," +
"area=?," +
"provider_code=?," +
"adapt_machine_type=?," +
"recorder_id=?,"+
"record_date=?," +
"is_tradeflat_product=?," +
"appender_property=?," +
"remark=?," +
"status=?,"+
"drawing_piece_code=?," +
"is_buy=?," +
"balance_mode=?," +
//"create_user_id=?,"+
//"create_user=?,"+
"last_update_user_id=?,"+
"last_update_user=?,"+
"last_update_time=?,"+
"balance_customer_code=?,"+
"pic=?,"+
"recent_adjustprice_date=?,"+
"recent_adjusted_price=?,"+
"is_normal=?,"+
"warehouse_code=?,"+
"warehouse_name=?, is_update=?, plan_price=? where concentricity_code=?";

String updatetSql = "update t_product set " +
"apep_code=?," +
"concentricity_code=?," +
"name=?," +
"category_code=?,"+
"product_brand=?," +
"model=?," +
"spec=?," +
"unit_price=?," +
"product_unit=?,"+
"quality_assure_period=?," +
"manufaturer=?," +
"area=?," +
"provider_code=?," +
"adapt_machine_type=?," +
"recorder_id=?,"+
"record_date=?," +
"is_tradeflat_product=?," +
"appender_property=?," +
"remark=?," +
"status=?,"+
"drawing_piece_code=?," +
"is_buy=?," +
"balance_mode=?," +
//"create_user_id=?,"+
//"create_user=?,"+
"last_update_user_id=?,"+
"last_update_user=?,"+
"last_update_time=?,"+
"balance_customer_code=?,"+
"pic=?,"+
"recent_adjustprice_date=?,"+
"recent_adjusted_price=?,"+
"is_normal=?,"+
"warehouse_code=?,"+
"warehouse_name=?, is_update=?,plan_price=? where concentricity_code=?";

String updateProductKMSql = "update t_product set " +
"apep_code = ?," +
"concentricity_code=?," +
"name=?," +
"category_code=?,"+
"product_brand=?," +
"model=?," +
"spec=?," +
"unit_price=?," +
"product_unit=?,"+
"quality_assure_period=?," +
"manufaturer=?," +
"area=?," +
"provider_code=?," +
"adapt_machine_type=?," +
"recorder_id=?,"+
"record_date=?," +
"is_tradeflat_product=?," +
"appender_property=?," +
"remark=?," +
"status=?,"+
"drawing_piece_code=?," +
"is_buy=?," +
"balance_mode=?," +
//"create_user_id=?,"+
//"create_user=?,"+
"last_update_user_id=?,"+
"last_update_user=?,"+
"last_update_time=?,"+
"balance_customer_code=?,"+
"pic=?,"+
"recent_adjustprice_date=?,"+
"recent_adjusted_price=?,"+
"is_normal=?,"+
"warehouse_code=?,"+
"warehouse_name=?, is_update=?, plan_price=?,km_quality_assure_period=? where concentricity_code=?";

String updatetKMSql = "update t_product set " +
"apep_code=?," +
"concentricity_code=?," +
"name=?," +
"category_code=?,"+
"product_brand=?," +
"model=?," +
"spec=?," +
"unit_price=?," +
"product_unit=?,"+
"quality_assure_period=?," +
"manufaturer=?," +
"area=?," +
"provider_code=?," +
"adapt_machine_type=?," +
"recorder_id=?,"+
"record_date=?," +
"is_tradeflat_product=?," +
"appender_property=?," +
"remark=?," +
"status=?,"+
"drawing_piece_code=?," +
"is_buy=?," +
"balance_mode=?," +
//"create_user_id=?,"+
//"create_user=?,"+
"last_update_user_id=?,"+
"last_update_user=?,"+
"last_update_time=?,"+
"balance_customer_code=?,"+
"pic=?,"+
"recent_adjustprice_date=?,"+
"recent_adjusted_price=?,"+
"is_normal=?,"+
"warehouse_code=?,"+
"warehouse_name=?, is_update=?,plan_price=?,km_quality_assure_period=? where concentricity_code=?";

String insertKMSyncSql = "insert into t_product_sync (" +
"apep_code," +
"concentricity_code," +
"name," +
"category_code,"+
"product_brand," +
"model," +
"spec," +
"unit_price," +
"product_unit,"+
"quality_assure_period," +
"manufaturer," +
"area," +
"provider_code," +
"adapt_machine_type," +
"recorder_id,"+
"record_date," +
"is_tradeflat_product," +
"appender_property," +
"remark," +
"status,"+
"drawing_piece_code," +
"is_buy," +
"balance_mode," +
"create_user_id,"+
"create_user,"+
"create_time,"+
"last_update_user_id,"+
"last_update_user,"+
"last_update_time,"+
"balance_customer_code,"+
"pic,"+
"recent_adjustprice_date,"+
"recent_adjusted_price,"+
"is_normal,"+
"warehouse_code,"+
"warehouse_name, is_update,plan_price,km_quality_assure_period,product_type,is_bid,id"+
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";

String insertKMSyncDataSql = "insert into PRODUCT_SYN_DATA (" +
"table_name," +
"table_id," +
"failed_count," +
"failed_reason,"+
"id "+
") values (?,?,?,?, (select sys_guid() from dual))";

String insertProductBidSql = "insert into T_PRODUCT_BID (" +
"PRODUCT_ID," +
"PRODUCT_CODE," +
"PRODUCT_NAME,"+
"REMARK," +
"STATUS," +
"PRODUCT_TYPE," +
"PROVIDER_CODE,"+
"CREATE_TIME," +
"CREATE_USER," +
"CREATE_USER_ID," +
"LAST_UPDATE_TIME," +
"LAST_UPDATE_USER," +
"LAST_UPDATE_USER_ID,"+
"id" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

String insertProductTypeSql = "insert into T_PRODUCT_TYPE (" +
"PRODUCT_ID," +
"PRODUCT_CODE," +
"PRODUCT_TYPE,"+
"PROVIDER_CODE,"+
"REMARK," +
"CREATE_TIME," +
"CREATE_USER," +
"CREATE_USER_ID," +
"LAST_UPDATE_TIME," +
"LAST_UPDATE_USER," +
"LAST_UPDATE_USER_ID,"+
"IS_BID,"+
"IS_BALANCE,"+
"STATUS," +
"id" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

String insertProductTypeManagerSql = "insert into T_PRODUCT_TYPE_MANAGER (" +
"PRODUCT_TYPE,"+
"TYPE_NAME,"+
"REMARK," +
"TYPE_LEVEL," +
"UPPER_TYPE," +
"STATUS," +
"CREATE_USER_ID," +
"CREATE_USER," +
"CREATE_TIME," +
"LAST_UPDATE_USER_ID,"+
"LAST_UPDATE_USER," +
"LAST_UPDATE_TIME," +
"id" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?)";

String insertProductCategorySql = "insert into T_PRODUCT_CATEGORY (" +
"CODE," +
"NAME," +
"REMARK," +
"CATEGORY_LEVEL," +
"UPPER_CATEGORY," +
"IS_TRADEFLAT_CATEGORY," +
"CATEGORY_ID1," +
"CATEGORY_ID2," +
"STATUS," +
"CREATE_USER_ID," +
"CREATE_USER," +
"CREATE_TIME," +
"LAST_UPDATE_USER_ID,"+
"LAST_UPDATE_USER," +
"LAST_UPDATE_TIME," +
"LAST_NOTIFY_TIME," +
"NOTIFY_TIMES," +
"NOTIFY_RESULT," +
"NOTIFY_UPDATE_TIMES," +
"NOTIFY_UPDATE_RESULT," +
"id" +
") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,?,?,?)";

String updateProductSynConfigSql = "update product_syn_config set " +
"LAST_DATA_ID = ?," +
"LAST_DOWNLOAD_TIME=? " +
" where TABLE_NAME=?";

    /** 不进行事务处理的    insert方法*/
    public boolean insert(GSManufactureVO vo,Connection conn) throws GSException{
        String tSql = this.insertSql;
        Object[] tobj = new Object[38];
        tobj[0] = vo.getGs_manufacture_id();
        tobj[1] = vo.getGs_concentricity_id();
        tobj[2] = vo.getGs_manufacture_name();
        tobj[3] = vo.getGs_manufacture_category_id();
        tobj[4] = vo.getGs_manufacture_brand();
        tobj[5] = vo.getGs_manufacture_type();
        tobj[6] = vo.getGs_manufacture_spec();
        tobj[7] = vo.getGs_manufacture_unitprice();
        tobj[8] = vo.getGs_quant_unit();
        tobj[9] = vo.getGs_quality_assure_period();
        tobj[10] = vo.getGs_manufacturer_name();
        tobj[11] = vo.getGs_make_area();
        tobj[12] = vo.getGs_provider_id();
        tobj[13] = vo.getGs_adapt_machine_type();
        tobj[14] = vo.getGs_recorder_id();
        tobj[15] = vo.getGs_manufacture_record_date();
        tobj[16] = vo.getGs_is_tradeflat_manufacture();
        tobj[17] = vo.getGs_appender_property();
        tobj[18] = vo.getGs_remark();
        tobj[19] = vo.getGsValidity();
        tobj[20] = vo.getGs_drawing_peice_code();
        tobj[21] = vo.getIs_buy();
        tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
        tobj[23] = vo.getCreate_user_id();
        tobj[24] = vo.getCreate_user();
        tobj[25] = vo.getCreate_time();
        tobj[26] = vo.getLast_update_user_id();
        tobj[27] = vo.getLast_update_user();
        tobj[28] = vo.getLast_update_time();
        tobj[29] = vo.getBalance_customer_code();
        tobj[30] = vo.getPic();
        tobj[31] = vo.getRecent_adjustprice_date();
        tobj[32] = vo.getRecent_adjusted_price();
        tobj[33] = vo.getIs_normal();
        tobj[34] = vo.getWarehouse_code();
        tobj[35] = vo.getWarehouse_name();
        tobj[36] = vo.getIsupdate();
        tobj[37] = vo.getGs_planprice();
        try {
            return this.executeUpdate(conn, tSql, tobj);
        } catch (Exception e) {
            throw new GSException(GSException.E20042, GSException.E20042_MSG);
        }
    }
    
    /**
     * 添加产品信息
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean insert(GSManufactureVO vo) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.insertProductSql;
            Object[] tobj = new Object[38];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            tobj[23] = vo.getCreate_user_id();
            tobj[24] = vo.getCreate_user();
            tobj[25] = vo.getCreate_time();
            tobj[26] = vo.getLast_update_user_id();
            tobj[27] = vo.getLast_update_user();
            tobj[28] = vo.getLast_update_time();
            tobj[29] = vo.getBalance_customer_code();
            tobj[30] = vo.getPic();
            tobj[31] = vo.getRecent_adjustprice_date();
            tobj[32] = vo.getRecent_adjusted_price();
            tobj[33] = vo.getIs_normal();
            tobj[34] = vo.getWarehouse_code();
            tobj[35] = vo.getWarehouse_name();
            tobj[36] = vo.getIsupdate();
            tobj[37] = vo.getGs_planprice();
            try {
                bl = this.executeUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
            String tSql = this.insertSql;
            Object[] tobj = new Object[38];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            tobj[23] = vo.getCreate_user_id();
            tobj[24] = vo.getCreate_user();
            tobj[25] = vo.getCreate_time();
            tobj[26] = vo.getLast_update_user_id();
            tobj[27] = vo.getLast_update_user();
            tobj[28] = vo.getLast_update_time();
            tobj[29] = vo.getBalance_customer_code();
            tobj[30] = vo.getPic();
            tobj[31] = vo.getRecent_adjustprice_date();
            tobj[32] = vo.getRecent_adjusted_price();
            tobj[33] = vo.getIs_normal();
            tobj[34] = vo.getWarehouse_code();
            tobj[35] = vo.getWarehouse_name();
            tobj[36] = vo.getIsupdate();
            tobj[37] = vo.getGs_planprice();
            try {
                bl = this.executeUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }
        
        return bl;
    }
    
    /**
     * 添加产品信息,公里质保
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean insertForKM(GSManufactureVO vo) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.insertProductKMSql;
            Object[] tobj = new Object[39];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            tobj[23] = vo.getCreate_user_id();
            tobj[24] = vo.getCreate_user();
            tobj[25] = vo.getCreate_time();
            tobj[26] = vo.getLast_update_user_id();
            tobj[27] = vo.getLast_update_user();
            tobj[28] = vo.getLast_update_time();
            tobj[29] = vo.getBalance_customer_code();
            tobj[30] = vo.getPic();
            tobj[31] = vo.getRecent_adjustprice_date();
            tobj[32] = vo.getRecent_adjusted_price();
            tobj[33] = vo.getIs_normal();
            tobj[34] = vo.getWarehouse_code();
            tobj[35] = vo.getWarehouse_name();
            tobj[36] = vo.getIsupdate();
            tobj[37] = vo.getGs_planprice();
            tobj[38] = vo.getKm_quality_assure_period();
            try {
                bl = this.executeUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
            String tSql = this.insertKMSql;
            Object[] tobj = new Object[39];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            tobj[23] = vo.getCreate_user_id();
            tobj[24] = vo.getCreate_user();
            tobj[25] = vo.getCreate_time();
            tobj[26] = vo.getLast_update_user_id();
            tobj[27] = vo.getLast_update_user();
            tobj[28] = vo.getLast_update_time();
            tobj[29] = vo.getBalance_customer_code();
            tobj[30] = vo.getPic();
            tobj[31] = vo.getRecent_adjustprice_date();
            tobj[32] = vo.getRecent_adjusted_price();
            tobj[33] = vo.getIs_normal();
            tobj[34] = vo.getWarehouse_code();
            tobj[35] = vo.getWarehouse_name();
            tobj[36] = vo.getIsupdate();
            tobj[37] = vo.getGs_planprice();
            tobj[38] = vo.getKm_quality_assure_period();
            try {
                bl = this.executeUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }
        
        return bl;
    }
    
    
    /**
     * 添加产品信息,公里质保
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean insertForKM(GSManufactureVO vo,String providerid,String planprice) throws GSException {
        boolean bl = false; 
    
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.insertProductKMSql;
            Object[] tobj = new Object[39];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            tobj[23] = vo.getCreate_user_id();
            tobj[24] = vo.getCreate_user();
            tobj[25] = vo.getCreate_time();
            tobj[26] = vo.getLast_update_user_id();
            tobj[27] = vo.getLast_update_user();
            tobj[28] = vo.getLast_update_time();
            tobj[29] = vo.getBalance_customer_code();
            tobj[30] = vo.getPic();
            tobj[31] = vo.getRecent_adjustprice_date();
            tobj[32] = vo.getRecent_adjusted_price();
            tobj[33] = vo.getIs_normal();
            tobj[34] = vo.getWarehouse_code();
            tobj[35] = vo.getWarehouse_name();
            tobj[36] = vo.getIsupdate();
            tobj[37] = vo.getGs_planprice();
            tobj[38] = vo.getKm_quality_assure_period();
            try {
                bl = this.executeUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
            String tSql = this.insertKMSql;
            Object[] tobj = new Object[39];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            tobj[23] = vo.getCreate_user_id();
            tobj[24] = vo.getCreate_user();
            tobj[25] = vo.getCreate_time();
            tobj[26] = vo.getLast_update_user_id();
            tobj[27] = vo.getLast_update_user();
            tobj[28] = vo.getLast_update_time();
            tobj[29] = vo.getBalance_customer_code();
            tobj[30] = vo.getPic();
            tobj[31] = vo.getRecent_adjustprice_date();
            tobj[32] = vo.getRecent_adjusted_price();
            tobj[33] = vo.getIs_normal();
            tobj[34] = vo.getWarehouse_code();
            tobj[35] = vo.getWarehouse_name();
            tobj[36] = vo.getIsupdate();
            if(GSBaseConstants.IS_CENTER_WAREHOUSE!=null&&GSBaseConstants.IS_CENTER_WAREHOUSE.equals("true")){
            	vo.setGs_planprice(planprice);
            }
            tobj[37] = vo.getGs_planprice();
            tobj[38] = vo.getKm_quality_assure_period();
            try {
                bl = this.executeUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
            
            if(GSBaseConstants.IS_CENTER_WAREHOUSE!=null&&GSBaseConstants.IS_CENTER_WAREHOUSE.equals("true")){
            	  String sql = this.insertKMSyncSql;
                  Object[] obj = new Object[41];
                  obj[0] = vo.getGs_manufacture_id();
                  obj[1] = vo.getGs_concentricity_id();
                  obj[2] = vo.getGs_manufacture_name();
                  obj[3] = vo.getGs_manufacture_category_id();
                  obj[4] = vo.getGs_manufacture_brand();
                  obj[5] = vo.getGs_manufacture_type();
                  obj[6] = vo.getGs_manufacture_spec();
                  obj[7] = vo.getGs_manufacture_unitprice();
                  obj[8] = vo.getGs_quant_unit();
                  obj[9] = vo.getGs_quality_assure_period();
                  obj[10] = vo.getGs_manufacturer_name();
                  obj[11] = vo.getGs_make_area();
                  obj[12] = providerid;
                  obj[13] = vo.getGs_adapt_machine_type();
                  obj[14] = vo.getGs_recorder_id();
                  obj[15] = vo.getGs_manufacture_record_date();
                  obj[16] = vo.getGs_is_tradeflat_manufacture();
                  obj[17] = vo.getGs_appender_property();
                  obj[18] = vo.getGs_remark();
                  obj[19] = vo.getGsValidity();
                  obj[20] = vo.getGs_drawing_peice_code();
                  obj[21] = vo.getIs_buy();
                  obj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
                  obj[23] = vo.getCreate_user_id();
                  obj[24] = vo.getCreate_user();
                  obj[25] = vo.getCreate_time();
                  obj[26] = vo.getLast_update_user_id();
                  obj[27] = vo.getLast_update_user();
                  obj[28] = vo.getLast_update_time();
                  obj[29] = vo.getBalance_customer_code();
                  obj[30] = vo.getPic();
                  obj[31] = vo.getRecent_adjustprice_date();
                  obj[32] = vo.getRecent_adjusted_price();
                  obj[33] = vo.getIs_normal();
                  obj[34] = vo.getWarehouse_code();
                  obj[35] = vo.getWarehouse_name();
                  obj[36] = vo.getIsupdate();
                  obj[37] = planprice;
                  obj[38] = vo.getKm_quality_assure_period();
                  obj[39] = vo.getProductType().equals("")?"99":vo.getProductType();
                  obj[40] = vo.getBidType().equals("")?"99":vo.getBidType();
                  try {
                      bl = this.executeUpdate(sql, obj, null, "");
                  } catch (Exception e) {
                      throw new GSException(GSException.E20042, GSException.E20042_MSG);
                  }
                  
                  String sql2 = this.insertKMSyncDataSql;
                  Object[] obj2 = new Object[4];
                  obj2[0]="T_PRODUCT_SYNC";
                  obj2[1]= vo.getGs_concentricity_id();
                  obj2[2]= new Integer(0);
                  obj2[3]="getFailed";
                  
                  try {
                      bl = this.executeUpdate(sql2, obj2, null, "");
                  } catch (Exception e) {
                      throw new GSException(GSException.E20042, GSException.E20042_MSG);
                  }
      
            }
            
        }
        
        return bl;
    }
    
    /**
    * 添加产品信息,公里质保
    * 
    * @param 产品对象
    * 
    * @return boolean
    */
   public boolean insertForKM(GSManufactureVO vo,Connection con) throws GSException {
       boolean bl = false;
     //增加配置文件 判断湖南巴士计划价
       if(GSBaseConstants.PLANPRICE.equals("true")){
           String tSql = this.insertProductKMSql;
           Object[] tobj = new Object[39];
           tobj[0] = vo.getGs_manufacture_id();
           tobj[1] = vo.getGs_concentricity_id();
           tobj[2] = vo.getGs_manufacture_name();
           tobj[3] = vo.getGs_manufacture_category_id();
           tobj[4] = vo.getGs_manufacture_brand();
           tobj[5] = vo.getGs_manufacture_type();
           tobj[6] = vo.getGs_manufacture_spec();
           tobj[7] = vo.getGs_manufacture_unitprice();
           tobj[8] = vo.getGs_quant_unit();
           tobj[9] = vo.getGs_quality_assure_period();
           tobj[10] = vo.getGs_manufacturer_name();
           tobj[11] = vo.getGs_make_area();
           tobj[12] = vo.getGs_provider_id();
           tobj[13] = vo.getGs_adapt_machine_type();
           tobj[14] = vo.getGs_recorder_id();
           tobj[15] = vo.getGs_manufacture_record_date();
           tobj[16] = vo.getGs_is_tradeflat_manufacture();
           tobj[17] = vo.getGs_appender_property();
           tobj[18] = vo.getGs_remark();
           tobj[19] = vo.getGsValidity();
           tobj[20] = vo.getGs_drawing_peice_code();
           tobj[21] = vo.getIs_buy();
           tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
           tobj[23] = vo.getCreate_user_id();
           tobj[24] = vo.getCreate_user();
           tobj[25] = vo.getCreate_time();
           tobj[26] = vo.getLast_update_user_id();
           tobj[27] = vo.getLast_update_user();
           tobj[28] = vo.getLast_update_time();
           tobj[29] = vo.getBalance_customer_code();
           tobj[30] = vo.getPic();
           tobj[31] = vo.getRecent_adjustprice_date();
           tobj[32] = vo.getRecent_adjusted_price();
           tobj[33] = vo.getIs_normal();
           tobj[34] = vo.getWarehouse_code();
           tobj[35] = vo.getWarehouse_name();
           tobj[36] = vo.getIsupdate();
           tobj[37] = vo.getGs_planprice();
           tobj[38] = vo.getKm_quality_assure_period();
           try {
               bl = this.executeUpdate(con,tSql, tobj);
           } catch (Exception e) {
               throw new GSException(GSException.E20042, GSException.E20042_MSG);
           }
       }else{
           String tSql = this.insertKMSql;
           Object[] tobj = new Object[39];
           tobj[0] = vo.getGs_manufacture_id();
           tobj[1] = vo.getGs_concentricity_id();
           tobj[2] = vo.getGs_manufacture_name();
           tobj[3] = vo.getGs_manufacture_category_id();
           tobj[4] = vo.getGs_manufacture_brand();
           tobj[5] = vo.getGs_manufacture_type();
           tobj[6] = vo.getGs_manufacture_spec();
           tobj[7] = vo.getGs_manufacture_unitprice();
           tobj[8] = vo.getGs_quant_unit();
           tobj[9] = vo.getGs_quality_assure_period();
           tobj[10] = vo.getGs_manufacturer_name();
           tobj[11] = vo.getGs_make_area();
           tobj[12] = vo.getGs_provider_id();
           tobj[13] = vo.getGs_adapt_machine_type();
           tobj[14] = vo.getGs_recorder_id();
           tobj[15] = vo.getGs_manufacture_record_date();
           tobj[16] = vo.getGs_is_tradeflat_manufacture();
           tobj[17] = vo.getGs_appender_property();
           tobj[18] = vo.getGs_remark();
           tobj[19] = vo.getGsValidity();
           tobj[20] = vo.getGs_drawing_peice_code();
           tobj[21] = vo.getIs_buy();
           tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
           tobj[23] = vo.getCreate_user_id();
           tobj[24] = vo.getCreate_user();
           tobj[25] = vo.getCreate_time();
           tobj[26] = vo.getLast_update_user_id();
           tobj[27] = vo.getLast_update_user();
           tobj[28] = vo.getLast_update_time();
           tobj[29] = vo.getBalance_customer_code();
           tobj[30] = vo.getPic();
           tobj[31] = vo.getRecent_adjustprice_date();
           tobj[32] = vo.getRecent_adjusted_price();
           tobj[33] = vo.getIs_normal();
           tobj[34] = vo.getWarehouse_code();
           tobj[35] = vo.getWarehouse_name();
           tobj[36] = vo.getIsupdate();
           tobj[37] = vo.getGs_planprice();
           tobj[38] = vo.getKm_quality_assure_period();
           try {
               bl = this.executeUpdate(tSql, tobj, null, "");
           } catch (Exception e) {
               throw new GSException(GSException.E20042, GSException.E20042_MSG);
           }
       }
       
       return bl;
   }
    /**
     * 添加产品信息
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean update(GSManufactureVO vo) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.updateProductSql;
            Object[] tobj = new Object[36];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            //tobj[23] = vo.getCreate_user_id();
           // tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getGs_concentricity_id();
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
            String tSql = this.updatetSql;
            Object[] tobj = new Object[36];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            //tobj[23] = vo.getCreate_user_id();
           // tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getGs_concentricity_id();
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }
        
        return bl;
    }    
    
    /**
     * 添加产品信息,增加公里质保期
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean updateForKM(GSManufactureVO vo) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.updateProductKMSql;
            Object[] tobj = new Object[37];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
           // tobj[23] = vo.getCreate_user_id();
           // tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getKm_quality_assure_period();
            tobj[36] = vo.getGs_concentricity_id();
           
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
            String tSql = this.updatetKMSql;
            Object[] tobj = new Object[37];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            //tobj[23] = vo.getCreate_user_id();
            //tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getKm_quality_assure_period();
            tobj[36] = vo.getGs_concentricity_id();
           
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }
        
        return bl;
    }    
    
    /**
     * 添加产品信息
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean updateByCondition(GSManufactureVO vo) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.updateProductSql;
            Object[] tobj = new Object[36];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
            //tobj[23] = vo.getCreate_user_id();
            //tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getGs_concentricity_id();
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
           StringBuffer buffer = new StringBuffer(); 
           buffer.append("update t_product set " );
           String tSql = validation(buffer,vo);
           PreparedStatement ps;
            try {
                iConn = this.getConnetion();
                ps =iConn.prepareStatement(tSql);
                if(ps.executeUpdate()>0)  
                    bl=true;
                
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }finally{
                close(iPstmt);
                close(iConn);
                
            }
        }
        
        return bl;
    }  
    
    /**
     * 添加产品信息 ,质保期
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean updateByConditionKM(GSManufactureVO vo) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.updateProductKMSql;
            Object[] tobj = new Object[37];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
           // tobj[23] = vo.getCreate_user_id();
            //tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getKm_quality_assure_period();
            tobj[36] = vo.getGs_concentricity_id();
            
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
           StringBuffer buffer = new StringBuffer(); 
           buffer.append("update t_product set " );
           String tSql = validationKM(buffer,vo);
           PreparedStatement ps;
            try {
                iConn = this.getConnetion();
                ps =iConn.prepareStatement(tSql);
                if(ps.executeUpdate()>0)  
                    bl=true;
                
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }finally{
                close(iPstmt);
                close(iConn);
                
            }
        }
        
        return bl;
    }
    
    
    /**
     * 添加产品信息 ,质保期
     * 
     * @param 产品对象
     * 
     * @return boolean
     */
    public boolean updateByConditionKM(GSManufactureVO vo,String providerid,String planprice) throws GSException {
        boolean bl = false;
      //增加配置文件 判断湖南巴士计划价
        if(GSBaseConstants.PLANPRICE.equals("true")){
            String tSql = this.updateProductKMSql;
            Object[] tobj = new Object[37];
            tobj[0] = vo.getGs_manufacture_id();
            tobj[1] = vo.getGs_concentricity_id();
            tobj[2] = vo.getGs_manufacture_name();
            tobj[3] = vo.getGs_manufacture_category_id();
            tobj[4] = vo.getGs_manufacture_brand();
            tobj[5] = vo.getGs_manufacture_type();
            tobj[6] = vo.getGs_manufacture_spec();
            tobj[7] = vo.getGs_manufacture_unitprice();
            tobj[8] = vo.getGs_quant_unit();
            tobj[9] = vo.getGs_quality_assure_period();
            tobj[10] = vo.getGs_manufacturer_name();
            tobj[11] = vo.getGs_make_area();
            tobj[12] = vo.getGs_provider_id();
            tobj[13] = vo.getGs_adapt_machine_type();
            tobj[14] = vo.getGs_recorder_id();
            tobj[15] = vo.getGs_manufacture_record_date();
            tobj[16] = vo.getGs_is_tradeflat_manufacture();
            tobj[17] = vo.getGs_appender_property();
            tobj[18] = vo.getGs_remark();
            tobj[19] = vo.getGsValidity();
            tobj[20] = vo.getGs_drawing_peice_code();
            tobj[21] = vo.getIs_buy();
            tobj[22] = DefineDic.getBmode(vo.getGs_balance_mode());
           // tobj[23] = vo.getCreate_user_id();
            //tobj[24] = vo.getCreate_user();
            tobj[23] = vo.getLast_update_user_id();
            tobj[24] = vo.getLast_update_user();
            tobj[25] = vo.getLast_update_time();
            tobj[26] = vo.getBalance_customer_code();
            tobj[27] = vo.getPic();
            tobj[28] = vo.getRecent_adjustprice_date();
            tobj[29] = vo.getRecent_adjusted_price();
            tobj[30] = vo.getIs_normal();
            tobj[31] = vo.getWarehouse_code();
            tobj[32] = vo.getWarehouse_name();
            tobj[33] = vo.getIsupdate();
            tobj[34] = vo.getGs_planprice();
            tobj[35] = vo.getKm_quality_assure_period();
            tobj[36] = vo.getGs_concentricity_id();
            
            try {
                bl = this.executeModifyUpdate(tSql, tobj, null, "");
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }
        }else{
           StringBuffer buffer = new StringBuffer(); 
           buffer.append("update t_product set " );
           String tSql = validationKM(buffer,vo);
           PreparedStatement ps;
            try {
                iConn = this.getConnetion();
                ps =iConn.prepareStatement(tSql);
                if(ps.executeUpdate()>0)  
                    bl=true;
                
            } catch (Exception e) {
                throw new GSException(GSException.E20042, GSException.E20042_MSG);
            }finally{
                close(iPstmt);
                close(iConn);
                
            }
            
            if(GSBaseConstants.IS_CENTER_WAREHOUSE!=null&&GSBaseConstants.IS_CENTER_WAREHOUSE.equals("true")){
                StringBuffer buffer2 = new StringBuffer(); 
                buffer2.append("update t_product_sync set " );
                String tSql2 = validationKM(buffer2,vo,providerid,planprice);
                PreparedStatement ps2;
                 try {
                     iConn = this.getConnetion();
                     ps2 =iConn.prepareStatement(tSql2);
                     if(ps2.executeUpdate()>0)  
                    	 bl=true;
                     
                 } catch (Exception e) {
                     throw new GSException(GSException.E20042, GSException.E20042_MSG);
                 }finally{
                     close(iPstmt);
                     close(iConn);
                     
                 }
            }
            
            
        }
        
        return bl;
    }
    
    /**
     * @param aBuffer
     * @param aVo
     * @return
     */
    private String validation(StringBuffer aBuffer, GSManufactureVO vo) {
      
        String str [] = {"apep_code", "concentricity_code" ,
        "name" ,
        "category_code",
        "product_brand" ,
        "model" ,
        "spec" ,
        "unit_price" ,
        "product_unit",
        "quality_assure_period" ,
        "manufaturer" ,
        "area" ,
        "provider_code" ,
        "adapt_machine_type" ,
        "recorder_id",
        "record_date" ,
        "is_tradeflat_product " ,
        "appender_property " ,
        "remark " ,
        "status ",
        "drawing_piece_code " ,
        "is_buy " ,
        "balance_mode " ,
        //"create_user_id ",
        //"create_user ",
        "last_update_user_id ",
        "last_update_user ",
        "last_update_time ",
        "balance_customer_code ",
        "pic ",
        "recent_adjustprice_date ",
        "recent_adjusted_price ",
        "is_normal ",
        "warehouse_code ",
        "warehouse_name  ",
        "is_update ",
        "plan_price ",
        " where concentricity_code"};     
        if(vo.getGs_manufacture_id().equals("N/A")){
            aBuffer.append(str[0]);    
            aBuffer.append("='',");
        }else if(!vo.getGs_manufacture_id().equals("")){     
            aBuffer.append(str[0]);    
            aBuffer.append("='"+vo.getGs_manufacture_id()+"',");
        }
        aBuffer.append(str[1]);    
        aBuffer.append("='"+vo.getGs_concentricity_id()+"',");   
        if(vo.getGs_manufacture_name().equals("N/A")){
            aBuffer.append(str[2]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_manufacture_name().equals("")){     
            aBuffer.append(str[2]);    
            aBuffer.append("='"+ vo.getGs_manufacture_name()+"',"); 
        }
        if(vo.getGs_manufacture_category_id().equals("N/A")){
            aBuffer.append(str[3]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_manufacture_category_id().equals("")){
            aBuffer.append(str[3]);    
            aBuffer.append("='"+vo.getGs_manufacture_category_id()+"',"); 
        }
        if(vo.getGs_manufacture_brand().equals("N/A")){
            aBuffer.append(str[4]);    
            aBuffer.append("='',");   
        }else if(!vo.getGs_manufacture_brand().equals("")){
            aBuffer.append(str[4]);    
            aBuffer.append("='"+vo.getGs_manufacture_brand()+"',");   
        }
        if(vo.getGs_manufacture_type().equals("N/A")){
            aBuffer.append(str[5]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacture_type().equals("")){
            aBuffer.append(str[5]);    
            aBuffer.append("='"+vo.getGs_manufacture_type()+"',");  
 
        }
        if(vo.getGs_manufacture_spec().equals("N/A")){
            aBuffer.append(str[6]);    
            aBuffer.append("='',");    
        }else if(!vo.getGs_manufacture_spec().equals("")){
            aBuffer.append(str[6]);    
            aBuffer.append("='"+vo.getGs_manufacture_spec()+"',");               
        }
        if(!vo.getGs_manufacture_unitprice().equals("")){
            aBuffer.append(str[7]);    
            aBuffer.append("="+vo.getGs_manufacture_unitprice()+",");              
        }
        if(vo.getGs_quant_unit().equals("N/A")){
            aBuffer.append(str[8]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_quant_unit().equals("")){
            aBuffer.append(str[8]);    
            aBuffer.append("='"+vo.getGs_quant_unit()+"',"); 
        }
        if(vo.getGs_quality_assure_period().equals("N/A")){
            aBuffer.append(str[9]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_quality_assure_period().equals("")){
            aBuffer.append(str[9]);    
            aBuffer.append("='"+vo.getGs_quality_assure_period()+"',");  
        }
        if(vo.getGs_manufacturer_name().equals("N/A")){
            aBuffer.append(str[10]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacturer_name().equals("")){
            aBuffer.append(str[10]);    
            aBuffer.append("='"+vo.getGs_manufacturer_name()+"',");
        }
        if(vo.getGs_make_area().equals("N/A")){
            aBuffer.append(str[11]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_make_area().equals("")){
            aBuffer.append(str[11]);    
            aBuffer.append("='"+vo.getGs_make_area()+"',");  
        }
        if(vo.getGs_provider_id().equals("N/A")){
            aBuffer.append(str[12]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_provider_id().equals("")){
            aBuffer.append(str[12]);    
            aBuffer.append("='"+vo.getGs_provider_id()+"',");  
        }
        if(vo.getGs_adapt_machine_type().equals("N/A")){
            aBuffer.append(str[13]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_adapt_machine_type().equals("")){
            aBuffer.append(str[13]);    
            aBuffer.append("='"+vo.getGs_adapt_machine_type()+"',"); 
        }
        if(vo.getGs_recorder_id().equals("N/A")){
            aBuffer.append(str[14]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_recorder_id().equals("")){
            aBuffer.append(str[14]);    
            aBuffer.append("='"+vo.getGs_recorder_id()+"',");
        }
        if(vo.getGs_manufacture_record_date().equals("N/A")){
            aBuffer.append(str[15]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacture_record_date().equals("")){
            aBuffer.append(str[15]);    
            aBuffer.append("='"+vo.getGs_manufacture_record_date()+"',");  
        }
        if(vo.getGs_is_tradeflat_manufacture().equals("N/A")){
            aBuffer.append(str[16]);    
            aBuffer.append("='',");   
        }else if(!vo.getGs_is_tradeflat_manufacture().equals("")){
            aBuffer.append(str[16]);    
            aBuffer.append("='"+vo.getGs_is_tradeflat_manufacture()+"',");               
        }
        if(vo.getGs_appender_property().equals("N/A")){
            aBuffer.append(str[17]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_appender_property().equals("")){
            aBuffer.append(str[17]);    
            aBuffer.append("='"+vo.getGs_appender_property()+"',");             
        }
        if(vo.getGs_remark().equals("N/A")){
            aBuffer.append(str[18]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_remark().equals("")){
            aBuffer.append(str[18]);    
            aBuffer.append("='"+vo.getGs_remark()+"',"); 
        }
        if(vo.getGsValidity().equals("N/A")){
            aBuffer.append(str[19]);    
            aBuffer.append("='',");  
        }else if(!vo.getGsValidity().equals("")){
            aBuffer.append(str[19]);    
            aBuffer.append("='"+vo.getGsValidity()+"',");              
        }
        if(vo.getGs_drawing_peice_code().equals("N/A")){
            aBuffer.append(str[20]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_drawing_peice_code().equals("")){
            aBuffer.append(str[20]);    
            aBuffer.append("='"+vo.getGs_drawing_peice_code()+"',"); 
        }
        if(vo.getIs_buy().equals("N/A")){
            aBuffer.append(str[21]);    
            aBuffer.append("='',"); 
        }else if(!vo.getIs_buy().equals("")){
            aBuffer.append(str[21]);    
            aBuffer.append("='"+vo.getIs_buy()+"',");             
        }
        if(vo.getGs_balance_mode().equals("N/A")){
            aBuffer.append(str[22]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_balance_mode().equals("")){
            aBuffer.append(str[22]);    
            aBuffer.append("='"+DefineDic.getBmode(vo.getGs_balance_mode())+"',"); 
        }
//        if(vo.getCreate_user_id().equals("N/A")){
//            aBuffer.append(str[23]);    
//            aBuffer.append("='',"); 
//        }else if(!vo.getCreate_user_id().equals("")){
//            aBuffer.append(str[23]);    
//            aBuffer.append("='"+vo.getCreate_user_id()+"',"); 
//        }
//        if(vo.getCreate_user().equals("N/A")){
//            aBuffer.append(str[24]);    
//            aBuffer.append("='',"); 
//        }else if(!vo.getCreate_user().equals("")){
//            aBuffer.append(str[24]);    
//            aBuffer.append("='"+vo.getCreate_user()+"',");  
//        }
        if(vo.getLast_update_user_id().equals("N/A")){
            aBuffer.append(str[23]);    
            aBuffer.append("='',");   
        }else if(!vo.getLast_update_user_id().equals("")){
            aBuffer.append(str[23]);    
            aBuffer.append("='"+vo.getLast_update_user_id()+"',");   
        }
        if(vo.getLast_update_user().equals("N/A")){
            aBuffer.append(str[24]);    
            aBuffer.append("='',");    
        }else if(!vo.getLast_update_user().equals("")){
            aBuffer.append(str[24]);    
            aBuffer.append("='"+vo.getLast_update_user()+"',");               
        }
        if(vo.getLast_update_time().equals("N/A")){
            aBuffer.append(str[25]);    
            aBuffer.append("='',");
        }else if(!vo.getLast_update_time().equals("")){
            aBuffer.append(str[25]);    
            aBuffer.append("='"+vo.getLast_update_time()+"',");
        }
        if(vo.getBalance_customer_code().equals("N/A")){
            aBuffer.append(str[26]);    
            aBuffer.append("='',");
        }else if(!vo.getBalance_customer_code().equals("")){
            aBuffer.append(str[26]);    
            aBuffer.append("='"+vo.getBalance_customer_code()+"',"); 
        }
        if(vo.getPic().equals("N/A")){
            aBuffer.append(str[27]);    
            aBuffer.append("='',");  
        }else if(!vo.getPic().equals("")){
            aBuffer.append(str[27]);    
            aBuffer.append("='"+vo.getPic()+"',");  
        }
        if(vo.getRecent_adjustprice_date().equals("N/A")){
            aBuffer.append(str[28]);    
            aBuffer.append("='',");  
        }else if(!vo.getRecent_adjustprice_date().equals("")){
            aBuffer.append(str[28]);    
            aBuffer.append("='"+vo.getRecent_adjustprice_date()+"',"); 
        }
        if(!vo.getRecent_adjusted_price().equals("")){
            aBuffer.append(str[29]);    
            aBuffer.append("="+vo.getRecent_adjusted_price()+","); 
        }
        if(vo.getIs_normal().equals("N/A")){
            aBuffer.append(str[30]);    
            aBuffer.append("='',");  
        }else if(!vo.getIs_normal().equals("")){
            aBuffer.append(str[30]);    
            aBuffer.append("='"+vo.getIs_normal()+"',");   
        }

            if(vo.getWarehouse_code().equals("N/A")){
                aBuffer.append(str[31]);    
                aBuffer.append("='',");  
            }else if(!vo.getWarehouse_code().equals("")){
                aBuffer.append(str[31]);    
                aBuffer.append("='"+vo.getWarehouse_code()+"',");  
            }
            if(vo.getWarehouse_name().equals("N/A")){
                aBuffer.append(str[32]);    
                aBuffer.append("='',");  
            }else if(!vo.getWarehouse_name().equals("")){
                aBuffer.append(str[32]);    
                aBuffer.append("='"+vo.getWarehouse_name()+"',");              
            } 
        
        if(vo.getIsupdate().equals("N/A")){
            aBuffer.append(str[33]);    
            aBuffer.append("='',");  
        }else if(!vo.getIsupdate().equals("")){
            aBuffer.append(str[33]);    
            aBuffer.append("='"+vo.getIsupdate()+"',");            
        }
        if(vo.getGs_planprice().equals("N/A")){
            aBuffer.append(str[34]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_planprice().equals("")){
            aBuffer.append(str[34]);    
            aBuffer.append("='"+vo.getGs_planprice()+"',");              
        }
        String sql = aBuffer.toString();
        String ss = sql.substring(0, sql.length()-1);
        return ""+ss+str[35]+"='"+vo.getGs_concentricity_id()+"'";
        
    }
    
    /**
     * @param aBuffer
     * @param aVo
     * @return
     */
    private String validationKM(StringBuffer aBuffer, GSManufactureVO vo) {
      
        String str [] = {"apep_code", "concentricity_code" ,
        "name" ,
        "category_code",
        "product_brand" ,
        "model" ,
        "spec" ,
        "unit_price" ,
        "product_unit",
        "quality_assure_period" ,
        "manufaturer" ,
        "area" ,
        "provider_code" ,
        "adapt_machine_type" ,
        "recorder_id",
        "record_date" ,
        "is_tradeflat_product " ,
        "appender_property " ,
        "remark " ,
        "status ",
        "drawing_piece_code " ,
        "is_buy " ,
        "balance_mode " ,
       // "create_user_id ",
       // "create_user ",
        "last_update_user_id ",
        "last_update_user ",
        "last_update_time ",
        "balance_customer_code ",
        "pic ",
        "recent_adjustprice_date ",
        "recent_adjusted_price ",
        "is_normal ",
        "warehouse_code ",
        "warehouse_name  ",
        "is_update ",
        "plan_price ",
        "KM_QUALITY_ASSURE_PERIOD ",
        " where concentricity_code"};     
        if(vo.getGs_manufacture_id().equals("N/A")){
            aBuffer.append(str[0]);    
            aBuffer.append("='',");
        }else if(!vo.getGs_manufacture_id().equals("")){     
            aBuffer.append(str[0]);    
            aBuffer.append("='"+vo.getGs_manufacture_id()+"',");
        }
        aBuffer.append(str[1]);    
        aBuffer.append("='"+vo.getGs_concentricity_id()+"',");   
        if(vo.getGs_manufacture_name().equals("N/A")){
            aBuffer.append(str[2]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_manufacture_name().equals("")){     
            aBuffer.append(str[2]);    
            aBuffer.append("='"+ vo.getGs_manufacture_name()+"',"); 
        }
        if(vo.getGs_manufacture_category_id().equals("N/A")){
            aBuffer.append(str[3]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_manufacture_category_id().equals("")){
            aBuffer.append(str[3]);    
            aBuffer.append("='"+vo.getGs_manufacture_category_id()+"',"); 
        }
        if(vo.getGs_manufacture_brand().equals("N/A")){
            aBuffer.append(str[4]);    
            aBuffer.append("='',");   
        }else if(!vo.getGs_manufacture_brand().equals("")){
            aBuffer.append(str[4]);    
            aBuffer.append("='"+vo.getGs_manufacture_brand()+"',");   
        }
        if(vo.getGs_manufacture_type().equals("N/A")){
            aBuffer.append(str[5]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacture_type().equals("")){
            aBuffer.append(str[5]);    
            aBuffer.append("='"+vo.getGs_manufacture_type()+"',");  
 
        }
        if(vo.getGs_manufacture_spec().equals("N/A")){
            aBuffer.append(str[6]);    
            aBuffer.append("='',");    
        }else if(!vo.getGs_manufacture_spec().equals("")){
            aBuffer.append(str[6]);    
            aBuffer.append("='"+vo.getGs_manufacture_spec()+"',");               
        }
        if(!vo.getGs_manufacture_unitprice().equals("")){
            aBuffer.append(str[7]);    
            aBuffer.append("="+vo.getGs_manufacture_unitprice()+",");              
        }
        if(vo.getGs_quant_unit().equals("N/A")){
            aBuffer.append(str[8]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_quant_unit().equals("")){
            aBuffer.append(str[8]);    
            aBuffer.append("='"+vo.getGs_quant_unit()+"',"); 
        }
        if(vo.getGs_quality_assure_period().equals("N/A")){
            aBuffer.append(str[9]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_quality_assure_period().equals("")){
            aBuffer.append(str[9]);    
            aBuffer.append("='"+vo.getGs_quality_assure_period()+"',");  
        }
        if(vo.getGs_manufacturer_name().equals("N/A")){
            aBuffer.append(str[10]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacturer_name().equals("")){
            aBuffer.append(str[10]);    
            aBuffer.append("='"+vo.getGs_manufacturer_name()+"',");
        }
        if(vo.getGs_make_area().equals("N/A")){
            aBuffer.append(str[11]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_make_area().equals("")){
            aBuffer.append(str[11]);    
            aBuffer.append("='"+vo.getGs_make_area()+"',");  
        }
        if(vo.getGs_provider_id().equals("N/A")){
            aBuffer.append(str[12]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_provider_id().equals("")){
            aBuffer.append(str[12]);    
            aBuffer.append("='"+vo.getGs_provider_id()+"',");  
        }
        if(vo.getGs_adapt_machine_type().equals("N/A")){
            aBuffer.append(str[13]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_adapt_machine_type().equals("")){
            aBuffer.append(str[13]);    
            aBuffer.append("='"+vo.getGs_adapt_machine_type()+"',"); 
        }
        if(vo.getGs_recorder_id().equals("N/A")){
            aBuffer.append(str[14]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_recorder_id().equals("")){
            aBuffer.append(str[14]);    
            aBuffer.append("='"+vo.getGs_recorder_id()+"',");
        }
        if(vo.getGs_manufacture_record_date().equals("N/A")){
            aBuffer.append(str[15]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacture_record_date().equals("")){
            aBuffer.append(str[15]);    
            aBuffer.append("='"+vo.getGs_manufacture_record_date()+"',");  
        }
        if(vo.getGs_is_tradeflat_manufacture().equals("N/A")){
            aBuffer.append(str[16]);    
            aBuffer.append("='',");   
        }else if(!vo.getGs_is_tradeflat_manufacture().equals("")){
            aBuffer.append(str[16]);    
            aBuffer.append("='"+vo.getGs_is_tradeflat_manufacture()+"',");               
        }
        if(vo.getGs_appender_property().equals("N/A")){
            aBuffer.append(str[17]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_appender_property().equals("")){
            aBuffer.append(str[17]);    
            aBuffer.append("='"+vo.getGs_appender_property()+"',");             
        }
        if(vo.getGs_remark().equals("N/A")){
            aBuffer.append(str[18]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_remark().equals("")){
            aBuffer.append(str[18]);    
            aBuffer.append("='"+vo.getGs_remark()+"',"); 
        }
        if(vo.getGsValidity().equals("N/A")){
            aBuffer.append(str[19]);    
            aBuffer.append("='',");  
        }else if(!vo.getGsValidity().equals("")){
            aBuffer.append(str[19]);    
            aBuffer.append("='"+vo.getGsValidity()+"',");              
        }
        if(vo.getGs_drawing_peice_code().equals("N/A")){
            aBuffer.append(str[20]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_drawing_peice_code().equals("")){
            aBuffer.append(str[20]);    
            aBuffer.append("='"+vo.getGs_drawing_peice_code()+"',"); 
        }
        if(vo.getIs_buy().equals("N/A")){
            aBuffer.append(str[21]);    
            aBuffer.append("='',"); 
        }else if(!vo.getIs_buy().equals("")){
            aBuffer.append(str[21]);    
            aBuffer.append("='"+vo.getIs_buy()+"',");             
        }
       if(vo.getGs_balance_mode().equals("N/A")){
            aBuffer.append(str[22]);    
            aBuffer.append("='',"); 
            }else if(!vo.getGs_balance_mode().equals("")){
            aBuffer.append(str[22]);    
            aBuffer.append("='"+DefineDic.getBmode(vo.getGs_balance_mode())+"',"); 
        }
//        if(vo.getCreate_user_id().equals("N/A")){
//            aBuffer.append(str[23]);    
//            aBuffer.append("='',"); 
//        }else if(!vo.getCreate_user_id().equals("")){
//            aBuffer.append(str[23]);    
//            aBuffer.append("='"+vo.getCreate_user_id()+"',"); 
//        }
//        if(vo.getCreate_user().equals("N/A")){
//            aBuffer.append(str[24]);    
//            aBuffer.append("='',"); 
//        }else if(!vo.getCreate_user().equals("")){
//            aBuffer.append(str[24]);    
//            aBuffer.append("='"+vo.getCreate_user()+"',");  
//        }
        if(vo.getLast_update_user_id().equals("N/A")){
            aBuffer.append(str[23]);    
            aBuffer.append("='',");   
        }else if(!vo.getLast_update_user_id().equals("")){
            aBuffer.append(str[23]);    
            aBuffer.append("='"+vo.getLast_update_user_id()+"',");   
        }
        if(vo.getLast_update_user().equals("N/A")){
            aBuffer.append(str[24]);    
            aBuffer.append("='',");    
        }else if(!vo.getLast_update_user().equals("")){
            aBuffer.append(str[24]);    
            aBuffer.append("='"+vo.getLast_update_user()+"',");               
        }
        if(vo.getLast_update_time().equals("N/A")){
            aBuffer.append(str[25]);    
            aBuffer.append("='',");
        }else if(!vo.getLast_update_time().equals("")){
            aBuffer.append(str[25]);    
            aBuffer.append("='"+vo.getLast_update_time()+"',");
        }
        if(vo.getBalance_customer_code().equals("N/A")){
            aBuffer.append(str[26]);    
            aBuffer.append("='',");
        }else if(!vo.getBalance_customer_code().equals("")){
            aBuffer.append(str[26]);    
            aBuffer.append("='"+vo.getBalance_customer_code()+"',"); 
        }
        if(vo.getPic().equals("N/A")){
            aBuffer.append(str[27]);    
            aBuffer.append("='',");  
        }else if(!vo.getPic().equals("")){
            aBuffer.append(str[27]);    
            aBuffer.append("='"+vo.getPic()+"',");  
        }
        if(vo.getRecent_adjustprice_date().equals("N/A")){
            aBuffer.append(str[28]);    
            aBuffer.append("='',");  
        }else if(!vo.getRecent_adjustprice_date().equals("")){
            aBuffer.append(str[28]);    
            aBuffer.append("='"+vo.getRecent_adjustprice_date()+"',"); 
        }
        if(!vo.getRecent_adjusted_price().equals("")){
            aBuffer.append(str[29]);    
            aBuffer.append("="+vo.getRecent_adjusted_price()+","); 
        }
        if(vo.getIs_normal().equals("N/A")){
            aBuffer.append(str[30]);    
            aBuffer.append("='',");  
        }else if(!vo.getIs_normal().equals("")){
            aBuffer.append(str[30]);    
            aBuffer.append("='"+vo.getIs_normal()+"',");   
        }

            if(vo.getWarehouse_code().equals("N/A")){
                aBuffer.append(str[31]);    
                aBuffer.append("='',");  
            }else if(!vo.getWarehouse_code().equals("")){
                aBuffer.append(str[31]);    
                aBuffer.append("='"+vo.getWarehouse_code()+"',");  
            }
            if(vo.getWarehouse_name().equals("N/A")){
                aBuffer.append(str[32]);    
                aBuffer.append("='',");  
            }else if(!vo.getWarehouse_name().equals("")){
                aBuffer.append(str[32]);    
                aBuffer.append("='"+vo.getWarehouse_name()+"',");              
            } 
        
        if(vo.getIsupdate().equals("N/A")){
            aBuffer.append(str[33]);    
            aBuffer.append("='',");  
        }else if(!vo.getIsupdate().equals("")){
            aBuffer.append(str[33]);    
            aBuffer.append("='"+vo.getIsupdate()+"',");            
        }
        if(vo.getGs_planprice().equals("N/A")){
            aBuffer.append(str[34]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_planprice().equals("")){
            aBuffer.append(str[34]);    
            aBuffer.append("='"+vo.getGs_planprice()+"',");              
        }
        if(vo.getIsupdate().equals("N/A")){
            aBuffer.append(str[35]);    
            aBuffer.append("='',");  
        }else if(!vo.getIsupdate().equals("")){
            aBuffer.append(str[35]);    
            aBuffer.append("='"+vo.getKm_quality_assure_period()+"',");            
        }
        String sql = aBuffer.toString();
        String ss = sql.substring(0, sql.length()-1);
        return ""+ss+str[36]+"='"+vo.getGs_concentricity_id()+"'";
        
    }
    
    
    /**
     * @param aBuffer
     * @param aVo
     * @return
     */
    private String validationKM(StringBuffer aBuffer, GSManufactureVO vo,String providerid,String planprice) {
      
        String str [] = {"apep_code", "concentricity_code" ,
        "name" ,
        "category_code",
        "product_brand" ,
        "model" ,
        "spec" ,
        "unit_price" ,
        "product_unit",
        "quality_assure_period" ,
        "manufaturer" ,
        "area" ,
        "provider_code" ,
        "adapt_machine_type" ,
        "recorder_id",
        "record_date" ,
        "is_tradeflat_product " ,
        "appender_property " ,
        "remark " ,
        "status ",
        "drawing_piece_code " ,
        "is_buy " ,
        "balance_mode " ,
       // "create_user_id ",
       // "create_user ",
        "last_update_user_id ",
        "last_update_user ",
        "last_update_time ",
        "balance_customer_code ",
        "pic ",
        "recent_adjustprice_date ",
        "recent_adjusted_price ",
        "is_normal ",
        "warehouse_code ",
        "warehouse_name  ",
        "is_update ",
        "plan_price ",
        "KM_QUALITY_ASSURE_PERIOD ",
        " where concentricity_code"};     
        if(vo.getGs_manufacture_id().equals("N/A")){
            aBuffer.append(str[0]);    
            aBuffer.append("='',");
        }else if(!vo.getGs_manufacture_id().equals("")){     
            aBuffer.append(str[0]);    
            aBuffer.append("='"+vo.getGs_manufacture_id()+"',");
        }
        aBuffer.append(str[1]);    
        aBuffer.append("='"+vo.getGs_concentricity_id()+"',");   
        if(vo.getGs_manufacture_name().equals("N/A")){
            aBuffer.append(str[2]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_manufacture_name().equals("")){     
            aBuffer.append(str[2]);    
            aBuffer.append("='"+ vo.getGs_manufacture_name()+"',"); 
        }
        if(vo.getGs_manufacture_category_id().equals("N/A")){
            aBuffer.append(str[3]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_manufacture_category_id().equals("")){
            aBuffer.append(str[3]);    
            aBuffer.append("='"+vo.getGs_manufacture_category_id()+"',"); 
        }
        if(vo.getGs_manufacture_brand().equals("N/A")){
            aBuffer.append(str[4]);    
            aBuffer.append("='',");   
        }else if(!vo.getGs_manufacture_brand().equals("")){
            aBuffer.append(str[4]);    
            aBuffer.append("='"+vo.getGs_manufacture_brand()+"',");   
        }
        if(vo.getGs_manufacture_type().equals("N/A")){
            aBuffer.append(str[5]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacture_type().equals("")){
            aBuffer.append(str[5]);    
            aBuffer.append("='"+vo.getGs_manufacture_type()+"',");  
 
        }
        if(vo.getGs_manufacture_spec().equals("N/A")){
            aBuffer.append(str[6]);    
            aBuffer.append("='',");    
        }else if(!vo.getGs_manufacture_spec().equals("")){
            aBuffer.append(str[6]);    
            aBuffer.append("='"+vo.getGs_manufacture_spec()+"',");               
        }
        if(!vo.getGs_manufacture_unitprice().equals("")){
            aBuffer.append(str[7]);    
            aBuffer.append("="+vo.getGs_manufacture_unitprice()+",");              
        }
        if(vo.getGs_quant_unit().equals("N/A")){
            aBuffer.append(str[8]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_quant_unit().equals("")){
            aBuffer.append(str[8]);    
            aBuffer.append("='"+vo.getGs_quant_unit()+"',"); 
        }
        if(vo.getGs_quality_assure_period().equals("N/A")){
            aBuffer.append(str[9]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_quality_assure_period().equals("")){
            aBuffer.append(str[9]);    
            aBuffer.append("='"+vo.getGs_quality_assure_period()+"',");  
        }
        if(vo.getGs_manufacturer_name().equals("N/A")){
            aBuffer.append(str[10]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacturer_name().equals("")){
            aBuffer.append(str[10]);    
            aBuffer.append("='"+vo.getGs_manufacturer_name()+"',");
        }
        if(vo.getGs_make_area().equals("N/A")){
            aBuffer.append(str[11]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_make_area().equals("")){
            aBuffer.append(str[11]);    
            aBuffer.append("='"+vo.getGs_make_area()+"',");  
        }
        if(vo.getGs_provider_id().equals("N/A")){
            aBuffer.append(str[12]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_provider_id().equals("")){
            aBuffer.append(str[12]);    
            aBuffer.append("='"+providerid+"',");  
        }
        if(vo.getGs_adapt_machine_type().equals("N/A")){
            aBuffer.append(str[13]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_adapt_machine_type().equals("")){
            aBuffer.append(str[13]);    
            aBuffer.append("='"+vo.getGs_adapt_machine_type()+"',"); 
        }
        if(vo.getGs_recorder_id().equals("N/A")){
            aBuffer.append(str[14]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_recorder_id().equals("")){
            aBuffer.append(str[14]);    
            aBuffer.append("='"+vo.getGs_recorder_id()+"',");
        }
        if(vo.getGs_manufacture_record_date().equals("N/A")){
            aBuffer.append(str[15]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_manufacture_record_date().equals("")){
            aBuffer.append(str[15]);    
            aBuffer.append("='"+vo.getGs_manufacture_record_date()+"',");  
        }
        if(vo.getGs_is_tradeflat_manufacture().equals("N/A")){
            aBuffer.append(str[16]);    
            aBuffer.append("='',");   
        }else if(!vo.getGs_is_tradeflat_manufacture().equals("")){
            aBuffer.append(str[16]);    
            aBuffer.append("='"+vo.getGs_is_tradeflat_manufacture()+"',");               
        }
        if(vo.getGs_appender_property().equals("N/A")){
            aBuffer.append(str[17]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_appender_property().equals("")){
            aBuffer.append(str[17]);    
            aBuffer.append("='"+vo.getGs_appender_property()+"',");             
        }
        if(vo.getGs_remark().equals("N/A")){
            aBuffer.append(str[18]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_remark().equals("")){
            aBuffer.append(str[18]);    
            aBuffer.append("='"+vo.getGs_remark()+"',"); 
        }
        if(vo.getGsValidity().equals("N/A")){
            aBuffer.append(str[19]);    
            aBuffer.append("='',");  
        }else if(!vo.getGsValidity().equals("")){
            aBuffer.append(str[19]);    
            aBuffer.append("='"+vo.getGsValidity()+"',");              
        }
        if(vo.getGs_drawing_peice_code().equals("N/A")){
            aBuffer.append(str[20]);    
            aBuffer.append("='',"); 
        }else if(!vo.getGs_drawing_peice_code().equals("")){
            aBuffer.append(str[20]);    
            aBuffer.append("='"+vo.getGs_drawing_peice_code()+"',"); 
        }
        if(vo.getIs_buy().equals("N/A")){
            aBuffer.append(str[21]);    
            aBuffer.append("='',"); 
        }else if(!vo.getIs_buy().equals("")){
            aBuffer.append(str[21]);    
            aBuffer.append("='"+vo.getIs_buy()+"',");             
        }
       if(vo.getGs_balance_mode().equals("N/A")){
            aBuffer.append(str[22]);    
            aBuffer.append("='',"); 
            }else if(!vo.getGs_balance_mode().equals("")){
            aBuffer.append(str[22]);    
            aBuffer.append("='"+DefineDic.getBmode(vo.getGs_balance_mode())+"',"); 
        }
//        if(vo.getCreate_user_id().equals("N/A")){
//            aBuffer.append(str[23]);    
//            aBuffer.append("='',"); 
//        }else if(!vo.getCreate_user_id().equals("")){
//            aBuffer.append(str[23]);    
//            aBuffer.append("='"+vo.getCreate_user_id()+"',"); 
//        }
//        if(vo.getCreate_user().equals("N/A")){
//            aBuffer.append(str[24]);    
//            aBuffer.append("='',"); 
//        }else if(!vo.getCreate_user().equals("")){
//            aBuffer.append(str[24]);    
//            aBuffer.append("='"+vo.getCreate_user()+"',");  
//        }
        if(vo.getLast_update_user_id().equals("N/A")){
            aBuffer.append(str[23]);    
            aBuffer.append("='',");   
        }else if(!vo.getLast_update_user_id().equals("")){
            aBuffer.append(str[23]);    
            aBuffer.append("='"+vo.getLast_update_user_id()+"',");   
        }
        if(vo.getLast_update_user().equals("N/A")){
            aBuffer.append(str[24]);    
            aBuffer.append("='',");    
        }else if(!vo.getLast_update_user().equals("")){
            aBuffer.append(str[24]);    
            aBuffer.append("='"+vo.getLast_update_user()+"',");               
        }
        if(vo.getLast_update_time().equals("N/A")){
            aBuffer.append(str[25]);    
            aBuffer.append("='',");
        }else if(!vo.getLast_update_time().equals("")){
            aBuffer.append(str[25]);    
            aBuffer.append("='"+vo.getLast_update_time()+"',");
        }
        if(vo.getBalance_customer_code().equals("N/A")){
            aBuffer.append(str[26]);    
            aBuffer.append("='',");
        }else if(!vo.getBalance_customer_code().equals("")){
            aBuffer.append(str[26]);    
            aBuffer.append("='"+vo.getBalance_customer_code()+"',"); 
        }
        if(vo.getPic().equals("N/A")){
            aBuffer.append(str[27]);    
            aBuffer.append("='',");  
        }else if(!vo.getPic().equals("")){
            aBuffer.append(str[27]);    
            aBuffer.append("='"+vo.getPic()+"',");  
        }
        if(vo.getRecent_adjustprice_date().equals("N/A")){
            aBuffer.append(str[28]);    
            aBuffer.append("='',");  
        }else if(!vo.getRecent_adjustprice_date().equals("")){
            aBuffer.append(str[28]);    
            aBuffer.append("='"+vo.getRecent_adjustprice_date()+"',"); 
        }
        if(!vo.getRecent_adjusted_price().equals("")){
            aBuffer.append(str[29]);    
            aBuffer.append("="+vo.getRecent_adjusted_price()+","); 
        }
        if(vo.getIs_normal().equals("N/A")){
            aBuffer.append(str[30]);    
            aBuffer.append("='',");  
        }else if(!vo.getIs_normal().equals("")){
            aBuffer.append(str[30]);    
            aBuffer.append("='"+vo.getIs_normal()+"',");   
        }

            if(vo.getWarehouse_code().equals("N/A")){
                aBuffer.append(str[31]);    
                aBuffer.append("='',");  
            }else if(!vo.getWarehouse_code().equals("")){
                aBuffer.append(str[31]);    
                aBuffer.append("='"+vo.getWarehouse_code()+"',");  
            }
            if(vo.getWarehouse_name().equals("N/A")){
                aBuffer.append(str[32]);    
                aBuffer.append("='',");  
            }else if(!vo.getWarehouse_name().equals("")){
                aBuffer.append(str[32]);    
                aBuffer.append("='"+vo.getWarehouse_name()+"',");              
            } 
        
        if(vo.getIsupdate().equals("N/A")){
            aBuffer.append(str[33]);    
            aBuffer.append("='',");  
        }else if(!vo.getIsupdate().equals("")){
            aBuffer.append(str[33]);    
            aBuffer.append("='"+vo.getIsupdate()+"',");            
        }
        if(vo.getGs_planprice().equals("N/A")){
            aBuffer.append(str[34]);    
            aBuffer.append("='',");  
        }else if(!vo.getGs_planprice().equals("")){
            aBuffer.append(str[34]);    
            aBuffer.append("='"+planprice+"',");              
        }
        if(vo.getIsupdate().equals("N/A")){
            aBuffer.append(str[35]);    
            aBuffer.append("='',");  
        }else if(!vo.getIsupdate().equals("")){
            aBuffer.append(str[35]);    
            aBuffer.append("='"+vo.getKm_quality_assure_period()+"',");            
        }
        String sql = aBuffer.toString();
        String ss = sql.substring(0, sql.length()-1);
        return ""+ss+str[36]+"='"+vo.getGs_concentricity_id()+"'";
        
    }


    public boolean invalidation(GSManufactureVO vo) throws GSException {
        boolean bl = false;
              String tSql = "update t_product set last_update_user_id=?,last_update_user=?,last_update_time=? ,auditing_status=? where concentricity_code=?";
              Object[] tobj = new Object[5];
              tobj[0] = vo.getLast_update_user_id();
              tobj[1] = vo.getLast_update_user();
              tobj[2] = vo.getLast_update_time();
              tobj[3] = "3";
              tobj[4] = vo.getGs_concentricity_id();
              try {
                  bl = this.executeModifyUpdate(tSql, tobj, null, "");
              } catch (Exception e) {
                  throw new GSException(GSException.E20042, GSException.E20042_MSG);
              }
          
          
          return bl;
      }
    /**
     * 查询产品信息
     * @param manufactureId         产品编码
     * @return                      产品数据对象
     * @throws GSException
     */
    public GSManufactureBean getManufacture(String manufactureId) throws GSException { 
		String tSql = "select * from t_product where apep_code = ?";
		ArrayList tList = null;
		GSManufactureBean tGSManufactureBean = null;
		Object[] tObj = {manufactureId};
		try{
			tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
			if(tList.size() >0){
			    tGSManufactureBean = (GSManufactureBean)tList.get(0);
			}else{
//				throw new GSException(GSException.BME20041,GSException.BME20041_MSG);
			}
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
		
		return tGSManufactureBean;
    }
    
    
    /**
     * 查询产品信息
     * @param manufactureId         产品编码
     * @return                      产品数据对象
     * @throws GSException
     */
    public GSManufactureBean getManufactureByConcentricityCode(String concentricityCode) throws GSException { 
		String tSql = "select * from t_product where CONCENTRICITY_CODE = ?";
		ArrayList tList = null;
		GSManufactureBean tGSManufactureBean = null;
		Object[] tObj = {concentricityCode};
		try{
			tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
			if(tList.size() >0){
			    tGSManufactureBean = (GSManufactureBean)tList.get(0);
			}else{
//				throw new GSException(GSException.BME20041,GSException.BME20041_MSG);
			}
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
		
		return tGSManufactureBean;
    }
    
    /**
     * 查询入库产品信息
     * @param manufactureId         产品编码
     * @return                      产品数据对象
     * @throws GSException
     */
    public GSManufactureBean getInManufacture(String manufactureId) throws GSException { 
        String tSql = "select * from t_product where ID = ?";
        ArrayList tList = null;
        GSManufactureBean tGSManufactureBean = null;
        Object[] tObj = {manufactureId};
        try{
            tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
            if(tList.size() >0){
                tGSManufactureBean = (GSManufactureBean)tList.get(0);
            }else{
//              throw new GSException(GSException.BME20041,GSException.BME20041_MSG);
            }
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        
        return tGSManufactureBean;
    }
    public GSManufactureBean getManufactureByGuId(String id) throws GSException { 
        String tSql = "select * from t_product where id = ?";
        ArrayList tList = null;
        GSManufactureBean tGSManufactureBean = null;
        Object[] tObj = {id};
        try{
            tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
            if(tList.size() >0){
                tGSManufactureBean = (GSManufactureBean)tList.get(0);
            }else{
//              throw new GSException(GSException.BME20041,GSException.BME20041_MSG);
            }
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        
        return tGSManufactureBean;
    }
    /**
     * 根据价格情况查询产品信息,取最优先的产品
     * @param concentricityId         产品集中编码
     * @return                      产品数据对象
     * @throws GSException
     */
    public GSManufactureBean getManufactureByUnitPrice(String concentricityId) throws GSException { 
		String tSql = "select * from t_product where CONCENTRICITY_CODE = ? ";
		ArrayList tList = null;
		GSManufactureBean tGSManufactureBean = null;
		Object[] tObj = {concentricityId};
		try{
			tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
			double min = Double.MAX_VALUE;
			if(tList.size() >= 1){
			    for(int i=0;i<tList.size();i++){
			        GSManufactureBean bean = (GSManufactureBean)tList.get(i);
			        double flat = bean.getGs_manufacture_unitprice();
			        if(flat <= min){
			            tGSManufactureBean = bean;
                        min = flat;
			        }
			    }
			    
			}else{
//				throw new GSException(GSException.BME20041,GSException.BME20041_MSG);
			}
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
		
		return tGSManufactureBean;
    }
    

    /*
     * 原来gs_concenricity_id只用来存集中码，现可能存14位集中码(上海),也可存自编码(深圳)
     * 下申购单步骤
     * 1. getManufactureByConcentricityId ，先查GS_CONCENTRICITY_ID字段
     * 2. getManufactureByIdBefore14 ，如上一步没查到产品则调用此方法，查GS_manufacture_ID的前14位(巴士自编的集中码)
     */
    public GSManufactureBean getManufactureByConcentricityId(String value,String sql) throws GSException {
       
		String tSql = sql +
				" and CONCENTRICITY_CODE = ? order by UNIT_PRICE";
		ArrayList tList = null;
		GSManufactureBean tGSManufactureBean = null;
		Object[] tObj = {value};
		try{
			tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
			if(tList.size() > 0)
			    tGSManufactureBean = (GSManufactureBean)tList.get(0);
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
		
		return tGSManufactureBean;
    }
    public GSManufactureBean getManufactureByConcentricityCode(String value,String sql) throws GSException {
        
        String tSql = sql +
                "  where  CONCENTRICITY_CODE = ? order by UNIT_PRICE";
        ArrayList tList = null;
        GSManufactureBean tGSManufactureBean = null;
        Object[] tObj = {value};
        try{
            tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
            if(tList.size() > 0)
                tGSManufactureBean = (GSManufactureBean)tList.get(0);
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        
        return tGSManufactureBean;
    }
    //集中码查询,查gs_manufacture_id前14位
    public GSManufactureBean getManufactureByIdBefore14(String value,String sql) throws GSException {
       
		String tSql = sql+
				" and APEP_CODE like ? order by UNIT_PRICE";
		ArrayList tList = null;
		GSManufactureBean tGSManufactureBean = null;
		Object[] tObj = {value+"____"};
		try{
			tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
			if(tList.size() > 0)
			    tGSManufactureBean = (GSManufactureBean)tList.get(0);
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
		
		return tGSManufactureBean;
    }
    
    
    
    public ArrayList getManufactureByProviderCode(String providerCode) throws GSException{
    	String sql = " select * from t_product where provider_code = ?";
    	ArrayList tList = null;
    	Object[] tObj = {providerCode};
    	try {
    		tList = this.executeQuery(new GSManufactureBean(),sql,tObj);
    		return tList;
		} catch (Exception e) {
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
    }
    
	//集中码查询,查GS_CONCENTRICITY_ID前12位
	public GSManufactureBean getManufactureByIdBefore12(String value,String sql) throws GSException {
       
		String tSql = sql +
				" and CONCENTRICITY_CODE like ? order by UNIT_PRICE";
		ArrayList tList = null;
		GSManufactureBean tGSManufactureBean = null;
		String strValue = value.trim();
		String unstr="";
		for (int i = 0; i < GSBaseConstants.PRODUCT_CONCENTRICITY-GSBaseConstants.MANUFACTURE_CODE_LENGTH; i++) {
		    unstr+="_";
        }
		if (strValue.length()==GSBaseConstants.MANUFACTURE_CODE_LENGTH)
		{
			strValue += unstr;
		}
		Object[] tObj = {strValue};
		try{
			tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
			if(tList.size() > 0)
				tGSManufactureBean = (GSManufactureBean)tList.get(0);
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
		
		return tGSManufactureBean;
	}    
    
    /**
     * 根据产品种类等级查询产品
     * @param aLevel            产品种类等级
     * @return                  符合条件的产品
     * @throws GSException
     */    
    public ArrayList queryManufactureByLevel(String aLevel) throws GSException {
        String tSql = "select * from GS_Manufacture where GS_MANUFACTURE_LEVEL=?";
        ArrayList tList = null;
        Object[] tObj = {aLevel};
        try{
            tList = this.executeQuery(new GSManufactureCategoryBean(),tSql,tObj);
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        return tList;
    }
    /**
     * 根据输入的查询SQL执行
     * @param aSql              查询SQL
     * @return                  产品对象
     * @throws GSException
     */
    public ArrayList queryManufactureByOpt(String aSql, int pageNo, int pageSize)throws GSException{
        ArrayList tList = null;
        Object[] tObj = {};
        try{
            tList = this.executeQuery(new GSManufactureBean(),aSql,tObj,pageNo,pageSize);
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E10030,GSException.E10030_MSG);
        }
        
        return tList;
    }
 
    /**
     * 根据输入的查询SQL执行
     * @param aSql              查询SQL
     * @return                  产品对象
     * @throws GSException
     */
    public ArrayList queryManufactureByOpt(String aSql)throws GSException{
        ArrayList tList = null;
        Object[] tObj = {};
        try{
            tList = this.executeQuery(new GSManufactureBean(),aSql,tObj);
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        
        return tList;
    }
    
    
    /**
     * 根据输入的查询SQL执行
     * @param aSql              查询SQL
     * @return                  产品对象
     * @throws GSException
     */
    public ArrayList queryManufactureByOptd(String aSql)throws GSException{
        ArrayList tList = null;
        Object[] tObj = {};
        try{
            tList = this.executeQuery(new GSManufactureBean(),aSql,tObj);
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        
        return tList;
    }
    
    /**
     * 在产品信息中新增一笔记录
     * @author owen
     * @param aGSManufactureBean
     * 
     * @return boolean
     * 
     * @throws CUPSException
     */
    public boolean add(GSManufactureBean aGSManufactureBean) throws GSException {

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String buf = df.format(new java.util.Date(System.currentTimeMillis()));
        
        String tSql="INSERT into GS_Manufacture (GS_MANUFACTURE_ID, GS_CONCENTRICITY_ID, " +
                "GS_MANUFACTURE_NAME, GS_MANUFACTURE_CATEGORY_ID, GS_MANUFACTURE_BRAND, GS_MANUFACTURE_TYPE, " +
                "GS_MANUFACTURE_SPEC, GS_MANUFACTURE_UNITPRICE, GS_QUANT_UNIT, GS_QUALITY_ASSURE_PERIOD, " +
                "GS_MANUFACTURER_NAME, GS_MAKE_AREA, GS_PROVIDER_ID, GS_ADAPT_MACHINE_TYPE, GS_MANUFACTURE_IMAGE, " +
                "GS_RECENT_ADJUSTPRICE_DATE, GS_RECENT_ADJUSTED_PRICE, GS_RECORDER_ID, " +
                "GS_MANUFACTURE_RECORD_DATE, GS_IS_TRADEFLAT_MANUFACTURE,GS_APPENDER_PROPERTY,GS_REMARK,GS_VALIDITY,GS_DRAWING_PIECE_CODE,is_buy,gs_balance_mode) VALUES  ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " +
                "?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)";

        Object[] tObject = new Object[26] ;
          tObject[0]=aGSManufactureBean.getGs_manufacture_id();
          tObject[1]=aGSManufactureBean.getGs_concentricity();
          tObject[2]=aGSManufactureBean.getGs_manufacture_name();
          tObject[3]=new Integer(aGSManufactureBean.getGs_manufacture_category_id());
          tObject[4]=aGSManufactureBean.getGs_manufacture_brand();
          tObject[5]=aGSManufactureBean.getGs_manufacture_type();
          tObject[6]=aGSManufactureBean.getGs_manufacture_spec();
          tObject[7]=new Double(aGSManufactureBean.getGs_manufacture_unitprice());
          tObject[8]=aGSManufactureBean.getGs_quant_unit();
          tObject[9]=aGSManufactureBean.getGs_quality_assure_period();
          tObject[10]=aGSManufactureBean.getGs_manufacturer_name();
          tObject[11]=aGSManufactureBean.getGs_make_area();
          tObject[12]=aGSManufactureBean.getGs_provider_id();
          tObject[13]=aGSManufactureBean.getGs_adapt_machine_type();
          tObject[14]=aGSManufactureBean.getGs_manufacture_images();
          tObject[15]=aGSManufactureBean.getGs_recent_adjustprice_date();
          tObject[16]=new Double(aGSManufactureBean.getGs_recent_adjusted_price());
          tObject[17]=aGSManufactureBean.getGs_recorder_id();
          tObject[18]=buf;
          tObject[19]=aGSManufactureBean.getGs_is_tradeflat_manufacture();
          tObject[20]=aGSManufactureBean.getGs_appender_property();
          tObject[21]=aGSManufactureBean.getGs_remark();
		  tObject[22]=aGSManufactureBean.getGs_validity();
		  tObject[23]=aGSManufactureBean.getGs_drawing_peice_code();
		  tObject[24]=aGSManufactureBean.getIs_buy();
		  tObject[25]=DefineDic.getBmode(aGSManufactureBean.getGs_balance_mode());
        boolean tResult = false;
        try {
            tResult = executeUpdate(tSql, tObject);

        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }

        return tResult;
    }
    
    /**
     * 产品信息是否存在
     * @author owen
     * @param aManfactureId
     * @return boolean
     * @throws GSException
     */
    public boolean isExist(String aManfactureId) throws GSException{
        String tSql = "select * from GS_Manufacture where GS_MANUFACTURE_ID = ?";
        boolean tFlag = false;
        Object[] tObj = {aManfactureId};
        try{
            ArrayList tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
            if(tList.size() > 0){
                tFlag = true;
            }
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        return tFlag;
    }
    
    /**
     * 根据产品种类名称和产品编号查询产品
     * @return                  符合条件的产品
     * @throws GSException
     */    
    public ArrayList queryManufacture(String aManfactureId,String aCategoryId1,
            String aCategoryId2,String aCategoryId3) throws GSException {
        StringBuffer tSql=null;
        tSql.append("select * from GS_Manufacture where GS_MANUFACTURE_ID like '%" + aManfactureId+ "%' ");
        if(aCategoryId1.equals("0")){
           tSql.append("and GS_MANUFACTURE_CATEGORY_ID like '%'");
        }
        else if(aCategoryId2.equals("0")){
           tSql.append("and GS_MANUFACTURE_CATEGORY_ID like '%" + aCategoryId1+ "%'");
        }
        else if(aCategoryId3.equals("0")){
           tSql.append("and GS_MANUFACTURE_CATEGORY_ID like '%" + aCategoryId2+ "%'");
         }
        else{
           tSql.append("and GS_MANUFACTURE_CATEGORY_ID like '%" + aCategoryId3+ "%'");
        }
        String tSqlAll=tSql.toString();
        ArrayList tList = null;
        Object[] tObj = {};
        try{
            tList = this.executeQuery(new GSManufactureBean(),tSqlAll,tObj);
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        return tList;
    }
    
    /**
     * 在产品同步队列表中删除一笔记录
     * @author owen
     * @param aManfactureId 产品编号
     *            
     */
    public boolean deleteSyncData(String concentricityCode) throws GSException {
        String tSql = "delete from product_syn_data where table_id=?";
        Object[] tObject = { concentricityCode };
        boolean tResult = false;
        try {
            tResult=executeUpdate(tSql, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }

        return tResult;
    }
    
    /**
     * 在产品同步队列表中增加上传失败次数
     * @author owen
     * @param aManfactureId 产品编号
     *            
     */
    public boolean addFailedCount(String concentricityCode) throws GSException {
        String tSql = "update product_syn_data set failed_count=failed_count+1 where table_id=?";
        Object[] tObject = { concentricityCode };
        boolean tResult = false;
        try {
            tResult=executeUpdate(tSql, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }

        return tResult;
    }
    
    
    /**
     * 在产品信息表中删除一笔记录
     * @author owen
     * @param aManfactureId 产品编号
     *            
     */
    public boolean delete(String aManfactureId) throws GSException {
        String tSql = "delete from GS_Manufacture where GS_MANUFACTURE_ID=?";
        Object[] tObject = { aManfactureId };
        boolean tResult = false;
        try {
            tResult=executeUpdate(tSql, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }

        return tResult;
    }
    public boolean deleteProduct(String aManfactureId) throws GSException {
        String tSql = "delete from t_product where concentricity_code=?";
        Object[] tObject = { aManfactureId };
        boolean tResult = false;
        try {
            tResult=executeUpdate(tSql, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }

        return tResult;
    }
    /**
     * 在产品信息表中更新一笔记录
     * 
     * @author owen
     * @param GSManufactureBean
     * @throws CUPSException
     *             return boolean
     */
    public boolean modify2(GSManufactureVO aGSManufactureBean) throws GSException {

        String tSql = "UPDATE t_product SET CONCENTRICITY_CODE=?, " + "NAME=?, CATEGORY_CODE=?, PRODUCT_BRAND=?,"
                + "MODEL=?,SPEC=?, UNIT_PRICE=?, "
                + "PRODUCT_UNIT=?, QUALITY_ASSURE_PERIOD=?,MANUFATURER=?, AREA=?,"
                + "PROVIDER_CODE=?, ADAPT_MACHINE_TYPE=?,APPENDER_PROPERTY=?,REMARK=?,STATUS=?,"
                + "IS_TRADEFLAT_PRODUCT=?,DRAWING_PIECE_CODE=?,IS_BUY=?,BALANCE_MODE=?," +
                "last_update_user_id = ?,"+
                "last_update_user = ?,"+
                "last_update_time = ?,is_update=?,PLAN_PRICE=?"+
                " where apep_code=?";
        String tSql2 = "UPDATE t_product SET CONCENTRICITY_CODE=?, " + "NAME=?, CATEGORY_CODE=?, PRODUCT_BRAND=?,"
            + "MODEL=?,SPEC=?, UNIT_PRICE=?, "
            + "PRODUCT_UNIT=?, QUALITY_ASSURE_PERIOD=?,MANUFATURER=?, AREA=?,"
            + "PROVIDER_CODE=?, ADAPT_MACHINE_TYPE=?,APPENDER_PROPERTY=?,REMARK=?,STATUS=?,"
            + "IS_TRADEFLAT_PRODUCT=?,DRAWING_PIECE_CODE=?,IS_BUY=?,BALANCE_MODE=?," +
            "last_update_user_id = ?,"+
            "last_update_user = ?,"+
            "last_update_time = ?,is_update=?,PLAN_PRICE=?"+
            " where apep_code=?";
        boolean tResult = false;
        if(GSBaseConstants.PLANPRICE.equals("true")){
        Object[] tObject = new Object[26];
        tObject[0] = aGSManufactureBean.getGs_concentricity_id();
        tObject[1] = aGSManufactureBean.getGs_manufacture_name();
        tObject[2] = aGSManufactureBean.getGs_manufacture_category_id();
        tObject[3] = aGSManufactureBean.getGs_manufacture_brand();
        tObject[4] = aGSManufactureBean.getGs_manufacture_type();
        tObject[5] = aGSManufactureBean.getGs_manufacture_spec();
        tObject[6] = String.valueOf(aGSManufactureBean.getGs_manufacture_unitprice());
        tObject[7] = aGSManufactureBean.getGs_quant_unit();
        tObject[8] = aGSManufactureBean.getGs_quality_assure_period();
        tObject[9] = aGSManufactureBean.getGs_manufacturer_name();
        tObject[10] = aGSManufactureBean.getGs_make_area();
        tObject[11] = aGSManufactureBean.getGs_provider_id();
        tObject[12] = aGSManufactureBean.getGs_adapt_machine_type();
        tObject[13] = aGSManufactureBean.getGs_appender_property();
        tObject[14] = aGSManufactureBean.getGs_remark();
        tObject[15] = aGSManufactureBean.getGsValidity();
        tObject[16] = aGSManufactureBean.getGs_is_tradeflat_manufacture();
        tObject[17] = aGSManufactureBean.getGs_drawing_peice_code();
        tObject[18] = aGSManufactureBean.getIs_buy();
        tObject[19] = DefineDic.getBmode(aGSManufactureBean.getGs_balance_mode());
        tObject[20]=aGSManufactureBean.getLast_update_user_id();
        tObject[21]=aGSManufactureBean.getLast_update_user();
        tObject[22]=aGSManufactureBean.getLast_update_time();
        tObject[23]=aGSManufactureBean.getIsupdate();
        tObject[24]=aGSManufactureBean.getGs_planprice();
        tObject[25]=aGSManufactureBean.getGs_manufacture_id();

        try {
            tResult = executeUpdate(tSql2, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }
        }else{
            Object[] tObject = new Object[26];
            tObject[0] = aGSManufactureBean.getGs_concentricity_id();
            tObject[1] = aGSManufactureBean.getGs_manufacture_name();
            tObject[2] = aGSManufactureBean.getGs_manufacture_category_id();
            tObject[3] = aGSManufactureBean.getGs_manufacture_brand();
            tObject[4] = aGSManufactureBean.getGs_manufacture_type();
            tObject[5] = aGSManufactureBean.getGs_manufacture_spec();
            tObject[6] = String.valueOf(aGSManufactureBean.getGs_manufacture_unitprice());
            tObject[7] = aGSManufactureBean.getGs_quant_unit();
            tObject[8] = aGSManufactureBean.getGs_quality_assure_period();
            tObject[9] = aGSManufactureBean.getGs_manufacturer_name();
            tObject[10] = aGSManufactureBean.getGs_make_area();
            tObject[11] = aGSManufactureBean.getGs_provider_id();
            tObject[12] = aGSManufactureBean.getGs_adapt_machine_type();
            tObject[13] = aGSManufactureBean.getGs_appender_property();
            tObject[14] = aGSManufactureBean.getGs_remark();
            tObject[15] = aGSManufactureBean.getGsValidity();
            tObject[16] = aGSManufactureBean.getGs_is_tradeflat_manufacture();
            tObject[17] = aGSManufactureBean.getGs_drawing_peice_code();
            tObject[18] = aGSManufactureBean.getIs_buy();
            tObject[19] = DefineDic.getBmode(aGSManufactureBean.getGs_balance_mode());
            tObject[20]=aGSManufactureBean.getLast_update_user_id();
            tObject[21]=aGSManufactureBean.getLast_update_user();
            tObject[22]=aGSManufactureBean.getLast_update_time();
            tObject[23]=aGSManufactureBean.getIsupdate();
            tObject[24]=aGSManufactureBean.getGs_planprice();
            tObject[25]=aGSManufactureBean.getGs_manufacture_id();
            
            try {
                tResult = executeUpdate(tSql, tObject);
            } catch (Exception ex) {
                GSLogWriter.error(this, ex.getMessage());
                throw new GSException(ex.getMessage());
            }
        }
        return tResult;
    }
    
    /**
     * 在产品信息表中更新一笔记录,车辆质保期
     * 
     * @author owen
     * @param GSManufactureBean
     * @throws CUPSException
     *             return boolean
     */
    public boolean modify2KM(GSManufactureVO aGSManufactureBean) throws GSException {

        String tSql = "UPDATE t_product SET CONCENTRICITY_CODE=?, " + "NAME=?, CATEGORY_CODE=?, PRODUCT_BRAND=?,"
                + "MODEL=?,SPEC=?, UNIT_PRICE=?, "
                + "PRODUCT_UNIT=?, QUALITY_ASSURE_PERIOD=?,MANUFATURER=?, AREA=?,"
                + "PROVIDER_CODE=?, ADAPT_MACHINE_TYPE=?,APPENDER_PROPERTY=?,REMARK=?,STATUS=?,"
                + "IS_TRADEFLAT_PRODUCT=?,DRAWING_PIECE_CODE=?,IS_BUY=?,BALANCE_MODE=?," +
                "last_update_user_id = ?,"+
                "last_update_user = ?,"+
                "last_update_time = ?,is_update=?,PLAN_PRICE=?,KM_QUALITY_ASSURE_PERIOD=?,BALANCE_CUSTOMER_CODE=?,PIC=? "+
                " where apep_code=?";
        String tSql2 = "UPDATE t_product SET CONCENTRICITY_CODE=?, " + "NAME=?, CATEGORY_CODE=?, PRODUCT_BRAND=?,"
            + "MODEL=?,SPEC=?, UNIT_PRICE=?, "
            + "PRODUCT_UNIT=?, QUALITY_ASSURE_PERIOD=?,MANUFATURER=?, AREA=?,"
            + "PROVIDER_CODE=?, ADAPT_MACHINE_TYPE=?,APPENDER_PROPERTY=?,REMARK=?,STATUS=?,"
            + "IS_TRADEFLAT_PRODUCT=?,DRAWING_PIECE_CODE=?,IS_BUY=?,BALANCE_MODE=?," +
            "last_update_user_id = ?,"+
            "last_update_user = ?,"+
            "last_update_time = ?,is_update=?,PLAN_PRICE=?,KM_QUALITY_ASSURE_PERIOD=?,BALANCE_CUSTOMER_CODE=?,PIC=?"+
            " where apep_code=?";
        boolean tResult = false;
        if(GSBaseConstants.PLANPRICE.equals("true")){
        Object[] tObject = new Object[29];
        tObject[0] = aGSManufactureBean.getGs_concentricity_id();
        tObject[1] = aGSManufactureBean.getGs_manufacture_name();
        tObject[2] = aGSManufactureBean.getGs_manufacture_category_id();
        tObject[3] = aGSManufactureBean.getGs_manufacture_brand();
        tObject[4] = aGSManufactureBean.getGs_manufacture_type();
        tObject[5] = aGSManufactureBean.getGs_manufacture_spec();
        tObject[6] = String.valueOf(aGSManufactureBean.getGs_manufacture_unitprice());
        tObject[7] = aGSManufactureBean.getGs_quant_unit();
        tObject[8] = aGSManufactureBean.getGs_quality_assure_period();
        tObject[9] = aGSManufactureBean.getGs_manufacturer_name();
        tObject[10] = aGSManufactureBean.getGs_make_area();
        tObject[11] = aGSManufactureBean.getGs_provider_id();
        tObject[12] = aGSManufactureBean.getGs_adapt_machine_type();
        tObject[13] = aGSManufactureBean.getGs_appender_property();
        tObject[14] = aGSManufactureBean.getGs_remark();
        tObject[15] = aGSManufactureBean.getGsValidity();
        tObject[16] = aGSManufactureBean.getGs_is_tradeflat_manufacture();
        tObject[17] = aGSManufactureBean.getGs_drawing_peice_code();
        tObject[18] = aGSManufactureBean.getIs_buy();
        tObject[19] = DefineDic.getBmode(aGSManufactureBean.getGs_balance_mode());
        tObject[20]=aGSManufactureBean.getLast_update_user_id();
        tObject[21]=aGSManufactureBean.getLast_update_user();
        tObject[22]=aGSManufactureBean.getLast_update_time();
        tObject[23]=aGSManufactureBean.getIsupdate();
        tObject[24]=aGSManufactureBean.getGs_planprice();
        tObject[25]=aGSManufactureBean.getKm_quality_assure_period();
        tObject[26]=aGSManufactureBean.getBalance_customer_code();
        tObject[27]=aGSManufactureBean.getPic();
        tObject[28]=aGSManufactureBean.getGs_manufacture_id();

        try {
            tResult = executeUpdate(tSql2, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }
        }else{
            Object[] tObject = new Object[29];
            tObject[0] = aGSManufactureBean.getGs_concentricity_id();
            tObject[1] = aGSManufactureBean.getGs_manufacture_name();
            tObject[2] = aGSManufactureBean.getGs_manufacture_category_id();
            tObject[3] = aGSManufactureBean.getGs_manufacture_brand();
            tObject[4] = aGSManufactureBean.getGs_manufacture_type();
            tObject[5] = aGSManufactureBean.getGs_manufacture_spec();
            tObject[6] = String.valueOf(aGSManufactureBean.getGs_manufacture_unitprice());
            tObject[7] = aGSManufactureBean.getGs_quant_unit();
            tObject[8] = aGSManufactureBean.getGs_quality_assure_period();
            tObject[9] = aGSManufactureBean.getGs_manufacturer_name();
            tObject[10] = aGSManufactureBean.getGs_make_area();
            tObject[11] = aGSManufactureBean.getGs_provider_id();
            tObject[12] = aGSManufactureBean.getGs_adapt_machine_type();
            tObject[13] = aGSManufactureBean.getGs_appender_property();
            tObject[14] = aGSManufactureBean.getGs_remark();
            tObject[15] = aGSManufactureBean.getGsValidity();
            tObject[16] = aGSManufactureBean.getGs_is_tradeflat_manufacture();
            tObject[17] = aGSManufactureBean.getGs_drawing_peice_code();
            tObject[18] = aGSManufactureBean.getIs_buy();
            tObject[19] = DefineDic.getBmode(aGSManufactureBean.getGs_balance_mode());
            tObject[20]=aGSManufactureBean.getLast_update_user_id();
            tObject[21]=aGSManufactureBean.getLast_update_user();
            tObject[22]=aGSManufactureBean.getLast_update_time();
            tObject[23]=aGSManufactureBean.getIsupdate();
            tObject[24]=aGSManufactureBean.getGs_planprice();
            tObject[25]=aGSManufactureBean.getKm_quality_assure_period();
            tObject[26]=aGSManufactureBean.getBalance_customer_code();
            tObject[27]=aGSManufactureBean.getPic();
            tObject[28]=aGSManufactureBean.getGs_manufacture_id();
            
            try {
                tResult = executeUpdate(tSql, tObject);
            } catch (Exception ex) {
                GSLogWriter.error(this, ex.getMessage());
                throw new GSException(ex.getMessage());
            }
        }
        return tResult;
    }
    
    
    public boolean modify(Connection con,String pid,String updateval) throws GSException{
        String sql="update t_product set is_update=? where id=?";
        Object[] tobj={updateval,pid};
        boolean bl=false;
        try {
            bl=this.executeUpdate(con,sql,tobj);
        } catch (SQLException e) {
            GSLogWriter.error(this, e.getMessage());
            throw new GSException(e.getMessage());
        }
        return bl;
    }
    /**
     * 在产品信息表中更新一笔记录
     * @author owen
     * @param GSManufactureBean
     * @throws CUPSException
     * return boolean
     */
    public boolean modify(GSManufactureBean aGSManufactureBean) throws GSException {

        String tSql = "UPDATE GS_Manufacture SET GS_CONCENTRICITY_ID=?, " +
                "GS_MANUFACTURE_NAME=?, GS_MANUFACTURE_CATEGORY_ID=?, GS_MANUFACTURE_BRAND=?," +
                "GS_MANUFACTURE_TYPE=?,GS_MANUFACTURE_SPEC=?, GS_MANUFACTURE_UNITPRICE=?, " +
                "GS_QUANT_UNIT=?, GS_QUALITY_ASSURE_PERIOD=?,GS_MANUFACTURER_NAME=?, GS_MAKE_AREA=?," +
                "GS_PROVIDER_ID=?, GS_ADAPT_MACHINE_TYPE=?,GS_APPENDER_PROPERTY=?,GS_REMARK=?,GS_VALIDITY=?," +
                //"GS_MANUFACTURE_IMAGE=?, " +
                //"GS_RECENT_ADJUSTPRICE_DATE=?, GS_RECENT_ADJUSTED_PRICE=?, GS_RECORDER_ID=?, " +
                //"GS_MANUFACTURE_RECORD_DATE=?, 
                "GS_IS_TRADEFLAT_MANUFACTURE=?,GS_DRAWING_PIECE_CODE=? " +
                "where GS_MANUFACTURE_ID=?";
        Object[] tObject = new Object[19];
        tObject[0] = aGSManufactureBean.getGs_concentricity();
        tObject[1] = aGSManufactureBean.getGs_manufacture_name();
        tObject[2] = aGSManufactureBean.getGs_manufacture_category_id();
        tObject[3] = aGSManufactureBean.getGs_manufacture_brand();
        tObject[4] = aGSManufactureBean.getGs_manufacture_type();
        tObject[5] = aGSManufactureBean.getGs_manufacture_spec();
        tObject[6] = String.valueOf(aGSManufactureBean.getGs_manufacture_unitprice());
        tObject[7] = aGSManufactureBean.getGs_quant_unit();
        tObject[8] = aGSManufactureBean.getGs_quality_assure_period();
        tObject[9] = aGSManufactureBean.getGs_manufacturer_name();
        tObject[10] = aGSManufactureBean.getGs_make_area();
        tObject[11] = aGSManufactureBean.getGs_provider_id();
        tObject[12] = aGSManufactureBean.getGs_adapt_machine_type();
        tObject[13] = aGSManufactureBean.getGs_appender_property();
        tObject[14] = aGSManufactureBean.getGs_remark();
        
		ArrayList mList = null;
		GSManufactureBean mGSManufactureBean = null;
		String mSql="select * from GS_Manufacture where GS_MANUFACTURE_ID=?";
		Object[] mObj = {aGSManufactureBean.getGs_manufacture_id()};
		try {       
			mList = this.executeQuery(new GSManufactureBean(),mSql,mObj);
			if(mList.size() == 1){
				mGSManufactureBean = (GSManufactureBean)mList.get(0);
				if("1".equals(mGSManufactureBean.getGs_validity()) && "1".equals(aGSManufactureBean.getGs_validity()))
				{
					tObject[15] = aGSManufactureBean.getGs_validity();
				}else
				{
					tObject[15] = "0";
				}
			}else
			{
				tObject[15] = aGSManufactureBean.getGs_validity();
			}
		}catch(Exception e){
			GSLogWriter.error(this,e.toString());
			throw new GSException(GSException.E19999,GSException.E19999_MSG);
		}
        
        //tObject[13] = aGSManufactureBean.getGs_manufacture_images();
        //tObject[14] = aGSManufactureBean.getGs_recent_adjustprice_date();
        //tObject[15] = String.valueOf(aGSManufactureBean.getGs_recent_adjusted_price());
        //tObject[16] = aGSManufactureBean.getGs_recorder_id();
        //tObject[18] = aGSManufactureBean.getGs_manufacture_record_date();
		tObject[16] = aGSManufactureBean.getGs_is_tradeflat_manufacture();
		tObject[17] = aGSManufactureBean.getGs_drawing_peice_code();
        tObject[18] = aGSManufactureBean.getGs_manufacture_id();
		
        
       

        boolean tResult = false;
        try {
            tResult = executeUpdate(tSql, tObject);
        } catch (Exception ex) {
            GSLogWriter.error(this, ex.getMessage());
            throw new GSException(ex.getMessage());
        }

        System.out.println("添加:"+tResult);
        return tResult;
    }
    
    /**
     * 修改网下产品信息的个别数据
     * @return  boolean 
     * @throws  GSException
     */
    public boolean modifyManufacture(GSManufactureBean aGSManufactureBean)throws GSException{
        //构造生成时间
        SimpleDateFormat tdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String createDate = tdf.format(new Date(System.currentTimeMillis()));
        
        String tSql= "update GS_MANUFACTURE set GS_MANUFACTURE_UNITPRICE = ?,GS_QUANT_UNIT=?," +
                "GS_QUALITY_ASSURE_PERIOD=?,GS_RECENT_ADJUSTPRICE_DATE=?,GS_RECENT_ADJUSTED_PRICE=?" +
                " where GS_MANUFACTURE_ID = ? ";   
        Object tObj[] = new Object[6];
        tObj[0] = StringUtils.formatEDouble(aGSManufactureBean.getGs_manufacture_unitprice(),2);
        tObj[1] = aGSManufactureBean.getGs_quant_unit();
        tObj[2] = aGSManufactureBean.getGs_quality_assure_period();
        tObj[3] = createDate;
        tObj[4] = StringUtils.formatEDouble(aGSManufactureBean.getGs_recent_adjusted_price(),2);        
        tObj[5] = aGSManufactureBean.getGs_manufacture_id();
       
        boolean tResult = false;
        try{
            tResult = executeUpdate(tSql,tObj);
        }catch(Exception ex){
            GSLogWriter.error(this,ex.getMessage());
            throw new GSException(ex.getMessage());
        }
        return tResult;
    }
    
    
    public void filter(String manufactureId) throws GSException {
        
        GSManufactureDAO tGSManufactureDAO=new GSManufactureDAO();
        GSManufactureProcessor tGSManufProcessor = new GSManufactureProcessor();
        //1.更新过滤表
        if(!"".equals(manufactureId) && manufactureId!=null){
                    
            //查找产品信息
            GSManufactureBean tGSManufactureBeanOld = tGSManufactureDAO.getManufacture(manufactureId);
            if(tGSManufactureBeanOld != null) {
                //从过滤表中删除所有统一集中编码的数据
                tGSManufactureDAO.delManufactureFilterEx(tGSManufactureBeanOld.getGs_concentricity());
    
                //2.从产品表中查出所有该集中编码的产品数据
                ArrayList tList = tGSManufProcessor.SeachManufactureEx(tGSManufactureBeanOld.getGs_concentricity());
                
                if(tList.size()>0) {
                    //第一条放入fitler表
                    GSManufactureBean tGSManufactureBeannew =new GSManufactureBean();
                    tGSManufactureBeannew=(GSManufactureBean)tList.get(0);
                    //将最低价的产品插入过滤表
                    if(tGSManufactureDAO.insertManufactureFilter(tGSManufactureBeannew)==false){
                        throw new GSException(GSException.E19994,GSException.E19994_MSG+":插入最低价格到过滤表失败！");
                    }
                }
            }
        }
    }
    
    /**
     * 查询产品信息
     * @param manufactureId         产品编码
     * @param
     * @return                      产品数据对象
     * @throws GSException
     */
    public GSManufactureBean getManufactureDetail(String tManufactureId,String tConcentricityId) throws GSException { 
        String tSql = "select * from t_product where apep_code = ? and CONCENTRICITY_code=?";
        ArrayList tList = null;
        GSManufactureBean tGSManufactureBean = null;
        Object[] tObj = {tManufactureId,tConcentricityId};
        try{
            tList = this.executeQuery(new GSManufactureBean(),tSql,tObj);
            if(tList.size() == 1){
                tGSManufactureBean = (GSManufactureBean)tList.get(0);
            }else{
//              throw new GSException(GSException.BME20041,GSException.BME20041_MSG);
            }
        }catch(Exception e){
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E19999,GSException.E19999_MSG);
        }
        
        return tGSManufactureBean;
    }
    //add by Sindy start
    
	/**
	* 修改产品信息表的is_buy值
	* @return  boolean 
	* @throws  GSException
	*/
	public boolean modifyManufactureIsBuy(String IsBuy,String Last_update_time,String Last_update_user_id,String Last_update_user,String ManufactureId)throws GSException{
    
		String tSql= "update t_product set is_buy=?,LAST_UPDATE_TIME=?,LAST_UPDATE_USER_ID=?,LAST_UPDATE_USER=? where APEP_CODE=?";

		Object[] tObj = {IsBuy,Last_update_time,Last_update_user_id,Last_update_user,ManufactureId};
       
		boolean tResult = false;
		try{
			tResult = executeUpdate(tSql,tObj);
		}catch(Exception ex){
			GSLogWriter.error(this,ex.getMessage());
			throw new GSException(ex.getMessage());
		}
		return tResult;
	}	
	
	
	/**
	* 修改产品信息表的GS_VALIDITY值
	* @return  boolean 
	* @throws  GSException
	*/
	public boolean modifyGs_validity(String gsValidity,String ManufactureId)throws GSException{
    
		String tSql= "update t_product set STATUS=? where APEP_CODE=?";
		Object[] tObj = {gsValidity,ManufactureId};
       
		boolean tResult = false;
		try{
			tResult = executeUpdate(tSql,tObj);
		}catch(Exception ex){
			GSLogWriter.error(this,ex.getMessage());
			throw new GSException(ex.getMessage());
		}
		return tResult;
	}	
	
    /**
    * 修改产品信息表的GS_VALIDITY值   不进行事务处理的
    * @return  boolean 
    * @throws  GSException
    */
    public boolean modifyGs_validity(String gsValidity,String ManufactureId,Connection conn)throws GSException{
        String tSql= "update t_product set STATUS=? where APEP_CODE=?";
        Object[] tObj = {gsValidity,ManufactureId};
       
        boolean tResult = false;
        try{
            tResult = executeUpdate(conn,tSql,tObj);
        }catch(Exception ex){
            GSLogWriter.error(this,ex.getMessage());
            throw new GSException(ex.getMessage());
        }
        return tResult;
    }
    
    /** 修改产品的曾用编码   */
    public boolean saveProductOldapepcode(String old_apep_code,String ManufactureId,Connection conn)throws GSException{
        String tSql= "update t_product set OLD_APEP_CODE=? where APEP_CODE=?";
        Object[] tObj = {old_apep_code,ManufactureId};
        boolean tResult = false;
        try{
            tResult = executeUpdate(conn,tSql,tObj);
        }catch(Exception ex){
            GSLogWriter.error(this,ex.getMessage());
            throw new GSException(ex.getMessage());
        }
        return tResult;
    }
	
	   /**
	    * 修改产品信息表的GS_BALANCE_MODE值
	    * @return  boolean 
	    * @throws  GSException
	    */
	    public boolean modifyGs_balance_mode(String aBalanceMode,String Last_update_time,String Last_update_user_id,String Last_update_user,String aManufactureId)throws GSException{
	        String tSql= "update t_product set BALANCE_MODE=?,LAST_UPDATE_TIME=?,LAST_UPDATE_USER_ID=?,LAST_UPDATE_USER=?  where APEP_CODE=?";
	        Object[] tObj = {DefineDic.getBmode(aBalanceMode),Last_update_time,Last_update_user_id,Last_update_user,aManufactureId};
	       
	        boolean tResult = false;
	        try{
	            tResult = executeUpdate(tSql,tObj);
	        }catch(Exception ex){
	            GSLogWriter.error(this,ex.getMessage());
	            throw new GSException(ex.getMessage());
	        }
	        return tResult;
	    }   
        /**
	        * 修改产品信息表的GS_BALANCE_MODE值,审批通过，审批不通过
	        * @return  boolean 
	        * @throws  GSException
	        */
	        public boolean modifyGSManufactureSetTemporary(String aManufactureId, String auditingValue)throws GSException{
	            String tSql= "update t_product set STATUS=1,AUDITING_STATUS=2 where CONCENTRICITY_CODE=?";
	            if(auditingValue.equals("no")){
	                tSql= "update t_product set STATUS=0,AUDITING_STATUS=3 where CONCENTRICITY_CODE=?"; 
	            }
	            
	            Object[] tObj = {aManufactureId};
	           
	            boolean tResult = false;
	            try{
	                tResult = executeUpdate(tSql,tObj);
	            }catch(Exception ex){
	                GSLogWriter.error(this,ex.getMessage());
	                throw new GSException(ex.getMessage());
	            }
	            return tResult;
	        }  
	        /**
	         * 修改产品信息表的GS_BALANCE_MODE值，审批待修改并添加审批意见
	         * @return  boolean 
	         * @throws  GSException
	         */
	         public boolean modifyGSManufactureSetTemporaryAddMessage(String aManufactureId, String message)throws GSException{
	         
	             String tSql= "update t_product set STATUS=0,AUDITING_STATUS=1, AUDITING_MESSAGE=? where CONCENTRICITY_CODE=?";
	             Object[] tObj = {message,aManufactureId};
	            
	             boolean tResult = false;
	             try{
	                 tResult = executeUpdate(tSql,tObj);
	             }catch(Exception ex){
	                 GSLogWriter.error(this,ex.getMessage());
	                 throw new GSException(ex.getMessage());
	             }
	             return tResult;
	         }  
	    
	
	
	
    /**
	    * 删除过滤表中所有同一集中编码的数据
	    * @return  boolean 
	    * @throws  GSException
	    */
	    public boolean delManufactureFilterEx(String ConcentricityId)throws GSException{
	    
	        String tSql="delete from gs_manufacture_filter where GS_CONCENTRICITY_ID =?";
	        Object[] tObj = {ConcentricityId};
	   
	        boolean tResult = false;
	        try{
	            tResult = executeUpdate(tSql,tObj);
	        }catch(Exception ex){
	            GSLogWriter.error(this,ex.getMessage());
	            throw new GSException(ex.getMessage());
	        }
	        return tResult;
	    }   

	   /**
	    * 根据18位码删除过滤表与产品表相同的数据
	    * @return  boolean 
	    * @throws  GSException
	    */
	    public boolean delManufactureFilterBy18(String ManufactureId)throws GSException{
	    
	        String tSql="delete from gs_manufacture_filter where GS_MANUFACTURE_ID=?";
	        Object[] tObj = {ManufactureId};
	   
	        boolean tResult = true;
	        try{
	            tResult = executeUpdate(tSql,tObj);
	        }catch(Exception ex){
	            GSLogWriter.error(this,ex.getMessage());
	            tResult = false;
	            throw new GSException(ex.getMessage());
	        }
	        return tResult;
	    }
	
	/**
	* 插入产品过滤表中符合条件的记录
	* @return  boolean 
	* @throws  GSException
	*/
	public boolean insertManufactureFilter(GSManufactureBean aGSManufactureBean)throws GSException{
		
		String tSql="INSERT into GS_Manufacture_filter (GS_MANUFACTURE_ID, GS_CONCENTRICITY_ID, " +
				"GS_MANUFACTURE_NAME, GS_MANUFACTURE_CATEGORY_ID, GS_MANUFACTURE_BRAND, GS_MANUFACTURE_TYPE, " +
				"GS_MANUFACTURE_SPEC, GS_MANUFACTURE_UNITPRICE, GS_QUANT_UNIT, GS_QUALITY_ASSURE_PERIOD, " +
				"GS_MANUFACTURER_NAME, GS_MAKE_AREA, GS_PROVIDER_ID, GS_ADAPT_MACHINE_TYPE, GS_MANUFACTURE_IMAGE, " +
				"GS_RECENT_ADJUSTPRICE_DATE, GS_RECENT_ADJUSTED_PRICE, GS_RECORDER_ID, " +
				"GS_MANUFACTURE_RECORD_DATE, GS_IS_TRADEFLAT_MANUFACTURE,GS_APPENDER_PROPERTY,GS_REMARK,GS_VALIDITY,CODE_BAK,GS_DRAWING_PIECE_CODE,IS_BUY,GS_BALANCE_MODE) VALUES  ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " +
				"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
		
		System.out.println("insert manufacture_id = "+aGSManufactureBean.getGs_manufacture_id());
		
		Object[] tObject = new Object[27] ;
		  tObject[0]=aGSManufactureBean.getGs_manufacture_id();
		  tObject[1]=aGSManufactureBean.getGs_concentricity();
		  tObject[2]=aGSManufactureBean.getGs_manufacture_name();
		  tObject[3]=new Integer(aGSManufactureBean.getGs_manufacture_category_id());
		  tObject[4]=aGSManufactureBean.getGs_manufacture_brand();
		  tObject[5]=aGSManufactureBean.getGs_manufacture_type();
		  tObject[6]=aGSManufactureBean.getGs_manufacture_spec();
		  tObject[7]=new Double(aGSManufactureBean.getGs_manufacture_unitprice());
		  tObject[8]=aGSManufactureBean.getGs_quant_unit();
		  tObject[9]=aGSManufactureBean.getGs_quality_assure_period();
		  tObject[10]=aGSManufactureBean.getGs_manufacturer_name();
		  tObject[11]=aGSManufactureBean.getGs_make_area();
		  tObject[12]=aGSManufactureBean.getGs_provider_id();
		  tObject[13]=aGSManufactureBean.getGs_adapt_machine_type();
		  tObject[14]=aGSManufactureBean.getGs_manufacture_images();
		  tObject[15]=aGSManufactureBean.getGs_recent_adjustprice_date();
		  tObject[16]=new Double(aGSManufactureBean.getGs_recent_adjusted_price());
		  tObject[17]=aGSManufactureBean.getGs_recorder_id();
		  tObject[18]=aGSManufactureBean.getGs_manufacture_record_date();
		  tObject[19]=aGSManufactureBean.getGs_is_tradeflat_manufacture();
		  tObject[20]=aGSManufactureBean.getGs_appender_property();
		  tObject[21]=aGSManufactureBean.getGs_remark();
		  tObject[22]=aGSManufactureBean.getGs_validity();
		  tObject[23]=aGSManufactureBean.getGs_code_bak();
		  tObject[24]=aGSManufactureBean.getGs_drawing_peice_code();
		  tObject[25]=aGSManufactureBean.getIs_buy();
		  tObject[26]=DefineDic.getBmode(aGSManufactureBean.getGs_balance_mode());
   
		boolean tResult = false;
		try{
			tResult = executeUpdate(tSql,tObject);
			System.out.println("insert manufacture_id = "+aGSManufactureBean.getGs_manufacture_id()+" ok");
		}catch(Exception ex){
		    System.out.println("insert manufacture_id = "+aGSManufactureBean.getGs_manufacture_id()+" error");
			GSLogWriter.error(this,ex.getMessage());
			throw new GSException(ex.getMessage());
		}
		return tResult;
	}		
	
	 /**
     * 查询产品的库存量
     * @return  boolean 
     * @throws  GSException
     */
     public String searchProductCount(String ManufactureId)throws GSException{
         String count = "0.0";
         String tSql="select * from T_PRODUCT_STORAGE where product_code = ?";
         ArrayList tList = null;
         GSProductStorageCount tGSManufactureBean = null;
         Object[] tObj = {ManufactureId};
         try{
             tList = this.executeQuery(new GSProductStorageCount(),tSql,tObj);
             double k = 0.0;
             if(tList.size()>0){
                 for(int i=0;i<tList.size();i++){
                 tGSManufactureBean = (GSProductStorageCount)tList.get(i); 
                 k = k + tGSManufactureBean.getProduct_count();
                 }
                 count = String.valueOf(k);
             }
         }catch(Exception e){
             GSLogWriter.error(this,e.toString());
             throw new GSException(GSException.E19999,GSException.E19999_MSG);
         }
         
         return count;
     }

     /**
      * 修改产品信息表的GS_BALANCE_MODE值
      * @return  boolean 
      * @throws  GSException
      */
      public boolean canChangeTemporary(String userId)throws GSException{
      
          String tSql= "select * from T_USER_MENUINFO where USER_ID=? and MENU_CODE=9999";
          Object[] tObj = {userId};
         
          boolean tResult = false;
          try{
              ArrayList tList = this.executeQuery(new GSUserMenuInfoBean(), tSql, tObj);
              if(tList.size() > 0){
                  tResult = true;
              }
          }catch(Exception ex){
              GSLogWriter.error(this,ex.getMessage());
              throw new GSException(ex.getMessage());
          }
          return tResult;
      }  
	//add by Sindy end
      
      public GSProductUpdatePriceBean getProductUpdatePriceByConcentricityCodeAndDate(String code,String date,String sql) throws GSException {
          
          String tSql = sql +
                  "  where  CONCENTRICITY_CODE = ?  and ENABLED_TIME=?  ";
          ArrayList tList = null;
          GSProductUpdatePriceBean tGSManufactureBean = null;
          Object[] tObj = {code,date};
          try{
              tList = this.executeQuery(new GSProductUpdatePriceBean(),tSql,tObj);
              if(tList.size() > 0)
                  tGSManufactureBean = (GSProductUpdatePriceBean)tList.get(0);
          }catch(Exception e){
              GSLogWriter.error(this,e.toString());
              throw new GSException(GSException.E19999,GSException.E19999_MSG);
          }
          
          return tGSManufactureBean;
      }
      
      
   public GSProductTemporaryMaintainBean getProductTemporaryMaintainByTemporaryConcentricityCode(String code,String sql) throws GSException {
          
          String tSql = sql +
                  "  where  TEMPORARY_CONCENTRICITY_CODE = ?   ";
          ArrayList tList = null;
          GSProductTemporaryMaintainBean tGSManufactureBean = null;
          Object[] tObj = {code};
          try{
              tList = this.executeQuery(new GSProductTemporaryMaintainBean(),tSql,tObj);
              if(tList.size() > 0)
                  tGSManufactureBean = (GSProductTemporaryMaintainBean)tList.get(0);
          }catch(Exception e){
              GSLogWriter.error(this,e.toString());
              throw new GSException(GSException.E19999,GSException.E19999_MSG);
          }
          
          return tGSManufactureBean;
      }
      
      
   public GSProductTemporaryBean getProductTemporaryByTemporaryConcentricityCode(String code,String sql) throws GSException {
       
       String tSql = sql +
               "  where  TEMPORARY_CONCENTRICITY_CODE = ?   ";
       ArrayList tList = null;
       GSProductTemporaryBean tGSManufactureBean = null;
       Object[] tObj = {code};
       try{
           tList = this.executeQuery(new GSProductTemporaryBean(),tSql,tObj);
           if(tList.size() > 0)
               tGSManufactureBean = (GSProductTemporaryBean)tList.get(0);
       }catch(Exception e){
           GSLogWriter.error(this,e.toString());
           throw new GSException(GSException.E19999,GSException.E19999_MSG);
       }
       
       return tGSManufactureBean;
   }  
      
 public GSProductUpdatePriceBean getProductUpdatePriceByConcentricityCodeAndLessDate(String code,String date,String sql) throws GSException {
          
          String tSql = sql +
                  "  where  CONCENTRICITY_CODE = ?  and ENABLED_TIME<=?  ";
          ArrayList tList = null;
          GSProductUpdatePriceBean tGSManufactureBean = null;
          Object[] tObj = {code,date};
          try{
              tList = this.executeQuery(new GSProductUpdatePriceBean(),tSql,tObj);
              if(tList.size() > 0)
                  tGSManufactureBean = (GSProductUpdatePriceBean)tList.get(0);
          }catch(Exception e){
              GSLogWriter.error(this,e.toString());
              throw new GSException(GSException.E19999,GSException.E19999_MSG);
          }
          
          return tGSManufactureBean;
      }
      
      
      
   public GSProductUpdateIsbuyBean getProductUpdateIsbuyByConcentricityCodeAndDate(String code,String date,String type,String sql) throws GSException {
          
          String tSql = sql +
                  "  where  CONCENTRICITY_CODE = ?  and ENABLED_TIME=? and TYPE=?  ";
          ArrayList tList = null;
          GSProductUpdateIsbuyBean tGSManufactureBean = null;
          Object[] tObj = {code,date,type};
          try{
              tList = this.executeQuery(new GSProductUpdateIsbuyBean(),tSql,tObj);
              if(tList.size() > 0)
                  tGSManufactureBean = (GSProductUpdateIsbuyBean)tList.get(0);
          }catch(Exception e){
              GSLogWriter.error(this,e.toString());
              throw new GSException(GSException.E19999,GSException.E19999_MSG);
          }
          
          return tGSManufactureBean;
      }
   
   public GSProductTemporaryMaintainBean getProductTemporaryMaintainByConcentricityCodeAndLessDate(String code,String date,String sql) throws GSException {
       
       String tSql = sql +
               "  where  CONCENTRICITY_CODE = ?  and ENABLED_TIME<=?  ";
       ArrayList tList = null;
       GSProductTemporaryMaintainBean tGSManufactureBean = null;
       Object[] tObj = {code,date};
       try{
           tList = this.executeQuery(new GSProductTemporaryMaintainBean(),tSql,tObj);
           if(tList.size() > 0)
               tGSManufactureBean = (GSProductTemporaryMaintainBean)tList.get(0);
       }catch(Exception e){
           GSLogWriter.error(this,e.toString());
           throw new GSException(GSException.E19999,GSException.E19999_MSG);
       }
       
       return tGSManufactureBean;
   }
      
  public GSProductUpdatePriceBean getProductUpdatePriceById(String id,String sql) throws GSException {
          
          String tSql = sql +
                  "  where  ID = ? ";
          ArrayList tList = null;
          GSProductUpdatePriceBean tGSManufactureBean = null;
          Object[] tObj = {id};
          try{
              tList = this.executeQuery(new GSProductUpdatePriceBean(),tSql,tObj);
              if(tList.size() > 0)
                  tGSManufactureBean = (GSProductUpdatePriceBean)tList.get(0);
          }catch(Exception e){
              GSLogWriter.error(this,e.toString());
              throw new GSException(GSException.E19999,GSException.E19999_MSG);
          }
          
          return tGSManufactureBean;
      }
  
  public GSProductUpdateIsbuyBean getProductUpdateIsbuyById(String id,String sql) throws GSException {
      
      String tSql = sql +
              "  where  ID = ? ";
      ArrayList tList = null;
      GSProductUpdateIsbuyBean tGSManufactureBean = null;
      Object[] tObj = {id};
      try{
          tList = this.executeQuery(new GSProductUpdateIsbuyBean(),tSql,tObj);
          if(tList.size() > 0)
              tGSManufactureBean = (GSProductUpdateIsbuyBean)tList.get(0);
      }catch(Exception e){
          GSLogWriter.error(this,e.toString());
          throw new GSException(GSException.E19999,GSException.E19999_MSG);
      }
      
      return tGSManufactureBean;
  }
  
  public GSProductTemporaryMaintainBean getProductTemporaryMaintainById(String id,String sql) throws GSException {
      
      String tSql = sql +
              "  where  ID = ? ";
      ArrayList tList = null;
      GSProductTemporaryMaintainBean tGSManufactureBean = null;
      Object[] tObj = {id};
      try{
          tList = this.executeQuery(new GSProductTemporaryMaintainBean(),tSql,tObj);
          if(tList.size() > 0)
              tGSManufactureBean = (GSProductTemporaryMaintainBean)tList.get(0);
      }catch(Exception e){
          GSLogWriter.error(this,e.toString());
          throw new GSException(GSException.E19999,GSException.E19999_MSG);
      }
      
      return tGSManufactureBean;
  }
      
      String insertProductUpdatePriceSql = "insert into t_product_update_price (" +
      "product_id," +
      "concentricity_code," +
      "before_price," +
      "after_price,"+
      "create_user_id,"+
      "create_user,"+
      "create_time,"+
      "auditing_user_id,"+
      "auditing_user,"+
      "auditing_time,"+
      "auditing_status,"+
      "enabled_time,"+
      "status,"+
      "id"+
      ") values (?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";
      
      /** 不进行事务处理的    insert方法*/
      public boolean insertProductUpdatePrice(GSProductUpdatePriceBean vo) throws GSException{
          String tSql = this.insertProductUpdatePriceSql;
          Object[] tobj = new Object[13];
          tobj[0] = vo.getGs_product_id();
          tobj[1] = vo.getGs_concentricity_code();
          tobj[2] = vo.getGs_before_price()+"";
          tobj[3] = vo.getGs_after_price()+"";
          tobj[4] = vo.getGs_create_user_id();
          tobj[5] = vo.getGs_create_user();
          tobj[6] = vo.getGs_create_time();
          tobj[7] = "";
          tobj[8] = "";
          tobj[9] = "";
          tobj[10] = vo.getGs_auditing_status();
          tobj[11] = vo.getGs_enabled_time();
          tobj[12] = vo.getGs_status();
        
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      String insertProductTemporaryMaintainSql = "insert into t_product_temporary_maintain (" +
      "product_id," +
      "concentricity_code," +
      "temporary_product_id," +
      "temporary_concentricity_code,"+
      "create_user_id,"+
      "create_user,"+
      "create_time,"+
      "auditing_user_id,"+
      "auditing_user,"+
      "auditing_time,"+
      "auditing_status,"+
      "enabled_time,"+
      "status,"+
      "id"+
      ") values (?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";
      
      /** 不进行事务处理的    insert方法*/
      public boolean insertProductTemporaryMaintain(GSProductTemporaryMaintainBean vo) throws GSException{
          String tSql = this.insertProductTemporaryMaintainSql;
          Object[] tobj = new Object[13];
          tobj[0] = vo.getGs_product_id();
          tobj[1] = vo.getGs_concentricity_code();
          tobj[2] = vo.getGs_temporary_product_id();
          tobj[3] = vo.getGs_temporary_concentricity_code();
          tobj[4] = vo.getGs_create_user_id();
          tobj[5] = vo.getGs_create_user();
          tobj[6] = vo.getGs_create_time();
          tobj[7] = "";
          tobj[8] = "";
          tobj[9] = "";
          tobj[10] = vo.getGs_auditing_status();
          tobj[11] = vo.getGs_enabled_time();
          tobj[12] = vo.getGs_status();
        
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      
      String insertProductUpdateIsbuySql = "insert into t_product_update_isbuy (" +
      "product_id," +
      "concentricity_code," +
      "type," +
      "create_user_id,"+
      "create_user,"+
      "create_time,"+
      "auditing_user_id,"+
      "auditing_user,"+
      "auditing_time,"+
      "auditing_status,"+
      "enabled_time,"+
      "status,"+
      "product_type,"+
      "product_bid,"+
      "id"+
      ") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";
      
      /** 不进行事务处理的    insert方法*/
      public boolean insertProductUpdateIsbuy(GSProductUpdateIsbuyBean vo) throws GSException{
          String tSql = this.insertProductUpdateIsbuySql;
          Object[] tobj = new Object[14];
          tobj[0] = vo.getGs_product_id();
          tobj[1] = vo.getGs_concentricity_code();
          tobj[2] = vo.getGs_type();
          tobj[3] = vo.getGs_create_user_id();
          tobj[4] = vo.getGs_create_user();
          tobj[5] = vo.getGs_create_time();
          tobj[6] = "";
          tobj[7] = "";
          tobj[8] = "";
          tobj[9] = vo.getGs_auditing_status();
          tobj[10] = vo.getGs_enabled_time();          
          tobj[11] = vo.getGs_status();
          tobj[12] = vo.getGs_product_type();
          tobj[13] = vo.getGs_product_bid();
        
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      
      String updateProductUpdatePriceSql = "update t_product_update_price set AUDITING_STATUS=? , AUDITING_USER_ID=? ,AUDITING_USER=? ,AUDITING_TIME=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductUpdatePrice(String status,String userid,String user,String time,String id) throws GSException{
          String tSql = this.updateProductUpdatePriceSql;
          Object[] tobj = new Object[5];
          tobj[0] = status;
          tobj[1] = userid;
          tobj[2] = user;
          tobj[3] = time;
          tobj[4] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      String updateProductUpdateIsbuySql = "update t_product_update_isbuy set AUDITING_STATUS=? , AUDITING_USER_ID=? ,AUDITING_USER=? ,AUDITING_TIME=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductUpdateIsbuy(String status,String userid,String user,String time,String id) throws GSException{
          String tSql = this.updateProductUpdateIsbuySql;
          Object[] tobj = new Object[5];
          tobj[0] = status;
          tobj[1] = userid;
          tobj[2] = user;
          tobj[3] = time;
          tobj[4] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      String updateProductTemporaryMaintainSql = "update t_product_temporary_maintain set AUDITING_STATUS=? , AUDITING_USER_ID=? ,AUDITING_USER=? ,AUDITING_TIME=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductTemporaryMaintain(String status,String userid,String user,String time,String id) throws GSException{
          String tSql = this.updateProductTemporaryMaintainSql;
          Object[] tobj = new Object[5];
          tobj[0] = status;
          tobj[1] = userid;
          tobj[2] = user;
          tobj[3] = time;
          tobj[4] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public ArrayList getProductSyncData() throws GSException{
        	String sql = " select b.* from product_syn_data a left join t_product_sync b on a.table_id=b.CONCENTRICITY_CODE ";
        	ArrayList tList = null;
        	Object[] tObj = {};
        	try {
        		tList = this.executeQuery(new GSManufactureSyncBean() ,sql,tObj);
        		return tList;
    		} catch (Exception e) {
    			GSLogWriter.error(this,e.toString());
    			throw new GSException(GSException.E19999,GSException.E19999_MSG);
    		}
        }
      
      public ArrayList getProductSyncConfig() throws GSException{
      	String sql = " select * from product_syn_config ";
      	ArrayList tList = null;
      	Object[] tObj = {};
      	try {
      		tList = this.executeQuery(new GSProductSynConfigBean() ,sql,tObj);
      		return tList;
  		} catch (Exception e) {
  			GSLogWriter.error(this,e.toString());
  			throw new GSException(GSException.E19999,GSException.E19999_MSG);
  		}
      }
      
      public ArrayList getProductUpdatePricesByDateAndAuditingStatus(String date,String auditingStatus) throws GSException{
      	String sql = " select * from t_product_update_price where ENABLED_TIME<=? and AUDITING_STATUS=? and STATUS!=1 ";
      	ArrayList tList = null;
      	Object[] tObj = {date,auditingStatus};
      	try {
      		tList = this.executeQuery(new GSProductUpdatePriceBean(),sql,tObj);
      		return tList;
  		} catch (Exception e) {
  			GSLogWriter.error(this,e.toString());
  			throw new GSException(GSException.E19999,GSException.E19999_MSG);
  		}
      }
      
      
    String updateProductByUpdatePriceSql = "update t_product set UNIT_PRICE=?,LAST_UPDATE_USER_ID=?,LAST_UPDATE_USER=?,LAST_UPDATE_TIME=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductByUpdatePrice(String afterprice,String userid,String user,String time,String productid,String isBuy,String status) throws GSException{
          String tSql = this.updateProductByUpdatePriceSql;
          if("0".equals(isBuy)){
        	  tSql+=",IS_BUY=1 ";
          }
          
          if("0".equals(status)){
        	  tSql+=",STATUS=1 ";
          }
          
          tSql+=" where id=? ";
          Object[] tobj = new Object[5];
          tobj[0] = afterprice;
          tobj[1] = userid;
          tobj[2] = user;
          tobj[3] = time;
          tobj[4] = productid;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public ArrayList getProductUpdateIsbuysByDateAndAuditingStatus(String date,String auditingStatus) throws GSException{
        	String sql = " select * from t_product_update_isbuy where ENABLED_TIME<=? and AUDITING_STATUS=? and STATUS!=1  ";
        	ArrayList tList = null;
        	Object[] tObj = {date,auditingStatus};
        	try {
        		tList = this.executeQuery(new GSProductUpdateIsbuyBean(),sql,tObj);
        		return tList;
    		} catch (Exception e) {
    			GSLogWriter.error(this,e.toString());
    			throw new GSException(GSException.E19999,GSException.E19999_MSG);
    		}
        }
      
  String updateProductByUpdateIsbuySql = "update t_product set IS_BUY=?,LAST_UPDATE_USER_ID=?,LAST_UPDATE_USER=?,LAST_UPDATE_TIME=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductByUpdateIsbuy(String isbuy,String userid,String user,String time,String productid) throws GSException{
          String tSql = this.updateProductByUpdateIsbuySql;
          Object[] tobj = new Object[5];
          tobj[0] = isbuy;
          tobj[1] = userid;
          tobj[2] = user;
          tobj[3] = time;
          tobj[4] = productid;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      
      String updateOrderDetailRejectSql = "update gs_order_detail set GS_ORDER_DETAIL_STATUS=?,GS_REJECT_CAUSE=?,GS_REJECT_DATE=?,GS_REJECT_TIME=? where GS_ORDER_DETAIL_ID=? ";
      /** 订单拒收调用方法*/
      public boolean updateOrderDetail(String status,String remark,String date,String time,String id) throws GSException{
          String tSql = this.updateOrderDetailRejectSql;
          Object[] tobj = new Object[5];
          tobj[0] = status;
          tobj[1] = remark;
          tobj[2] = date;
          tobj[3] = time;
          tobj[4] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      String updateOrderGoodsSql = "update gs_order_detail set GS_ORDER_DETAIL_STATUS=?,GS_SIGNIN_DATE=?,GS_SIGNIN_TIME=?,GS_SIGNIN_COUNT=?,GS_SIGNIN_PERSON=?,GS_SIGNIN_EXPLAIN=? where GS_ORDER_DETAIL_ID=? ";
      /** 订单拒收调用方法*/
      public boolean updateOrderGoods(String status,String date,String time,String count,String person,String remark,String id) throws GSException{
          String tSql = this.updateOrderGoodsSql;
          Object[] tobj = new Object[7];
          tobj[0] = status;
          tobj[1] = date;
          tobj[2] = time;
          tobj[3] = count;
          tobj[4] = person;
          tobj[5] = remark;
          tobj[6] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      String updateOrderGoodsNoSql = "update gs_order_detail set GS_SIGNIN_DATE=?,GS_SIGNIN_TIME=?,GS_SIGNIN_COUNT=?,GS_SIGNIN_PERSON=?,GS_SIGNIN_EXPLAIN=? where GS_ORDER_DETAIL_ID=? ";
      /** 订单拒收调用方法*/
      public boolean updateOrderGoodsNo(String date,String time,String count,String person,String remark,String id) throws GSException{
          String tSql = this.updateOrderGoodsNoSql;
          Object[] tobj = new Object[6];
          tobj[0] = date;
          tobj[1] = time;
          tobj[2] = count;
          tobj[3] = person;
          tobj[4] = remark;
          tobj[5] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      
      String insertOrderDetailSignInSql = "insert into GS_ORDER_DETAIL_SIGNIN (" +
      "GS_ORDER_DETAIL_ID," +
      "GS_ORDER_COUNT," +
      "GS_SIGNIN_COUNT," +
      "GS_SIGNIN_DATE,"+
      "GS_SIGNIN_TIME,"+
      "GS_SIGNIN_PERSON,"+
      "GS_SIGNIN_EXPLAIN,"+
      "CONCENTRICITY_CODE,"+
      "NAME,"+
      "SPEC,"+
      "MODEL,"+
      "PRODUCT_BRAND,"+
      "PROVIDER_CODE,"+
      "PROVIDER_NAME,"+
      "DRAWING_PIECE_CODE,"+
      "PRODUCT_UNIT,"+
      "ID"+
      ") values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";
      
      /** 不进行事务处理的    insert方法*/
      public boolean insertOrderDetailSignIn(String date,String time,String allCount,String count,String person,String remark,String id,GSManufactureBean manu,GSProviderBean provider) throws GSException{
          String tSql = this.insertOrderDetailSignInSql;
          Object[] tobj = new Object[16];
          tobj[0] = id;
          tobj[1] = allCount;
          tobj[2] = count;
          tobj[3] = date;
          tobj[4] = time;
          tobj[5] = person;
          tobj[6] = remark; 
          tobj[7] = manu.getGs_concentricity(); 
          tobj[8] = manu.getGs_manufacture_name();
          tobj[9] = manu.getGs_manufacture_spec();
          tobj[10] = manu.getGs_manufacture_type();
          tobj[11] = manu.getGs_manufacture_brand();
          tobj[12] = provider.getGs_provider_id();
          tobj[13] = provider.getGs_provider_name();   
          tobj[14] = manu.getGs_drawing_peice_code();
          tobj[15] = manu.getGs_quant_unit();
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      
      String updateOrderDetailConfirmSql = "update gs_order_detail set GS_ORDER_DETAIL_STATUS=? where GS_ORDER_DETAIL_ID=? ";
      /** 订单确认调用方法*/
      public boolean updateOrderDetail(String status,String id) throws GSException{
          String tSql = this.updateOrderDetailConfirmSql;
          Object[] tobj = new Object[2];
          tobj[0] = status;
          tobj[1] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public ArrayList getProductTemporaryMaintainsByDateAndAuditingStatus(String date,String auditingStatus) throws GSException{
      	String sql = " select * from t_product_temporary_maintain where ENABLED_TIME<=? and AUDITING_STATUS=? and STATUS!=1  ";
      	ArrayList tList = null;
      	Object[] tObj = {date,auditingStatus};
      	try {
      		tList = this.executeQuery(new GSProductTemporaryMaintainBean(),sql,tObj);
      		return tList;
  		} catch (Exception e) {
  			GSLogWriter.error(this,e.toString());
  			throw new GSException(GSException.E19999,GSException.E19999_MSG);
  		}
      }
      
      
      String insertProductTemporarySql = "insert into t_product_temporary (" +
      "concentricity_code," +
      "temporary_concentricity_code,"+
      "warehouse_code," +
      "warehouse_name,"+
      "create_user_id,"+
      "create_user,"+
      "create_time,"+
      "last_update_user_id,"+
      "last_update_user,"+
      "last_update_time,"+
      "is_temporary,"+
      "id"+
      ") values (?,?,?,?,?,?,?,?,?,?,?, (select sys_guid() from dual))";
      
      /** 不进行事务处理的    insert方法*/
      public boolean insertProductTemporary(GSProductTemporaryBean vo) throws GSException{
          String tSql = this.insertProductTemporarySql;
          Object[] tobj = new Object[11];
          tobj[0] = vo.getGs_concentricity_code();
          tobj[1] = vo.getGs_temporary_concentricity_code();
          tobj[2] = vo.getWarehouse_code();
          tobj[3] = vo.getWarehouse_name();
          tobj[4] = vo.getGs_create_user_id();
          tobj[5] = vo.getGs_create_user();
          tobj[6] = vo.getGs_create_time();
          tobj[7] = vo.getGs_last_update_user_id();
          tobj[8] = vo.getGs_last_update_user();
          tobj[9] = vo.getGs_last_update_time();
          tobj[10] ="0";
        
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      String updateProductUpdatePriceStatusSql = "update t_product_update_price set STATUS=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductUpdatePriceStatusSql(String status,String id) throws GSException{
          String tSql = this.updateProductUpdatePriceStatusSql;
          Object[] tobj = new Object[2];
          tobj[0] = status;
          tobj[1] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
   String updateProductUpdateIsbuyStatusSql = "update t_product_update_isbuy set STATUS=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductUpdateIsbuyStatusSql(String status,String id) throws GSException{
          String tSql = this.updateProductUpdateIsbuyStatusSql;
          Object[] tobj = new Object[2];
          tobj[0] = status;
          tobj[1] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
   String updateProductTemporaryMaintainStatusSql = "update t_product_temporary_maintain set STATUS=? where id=? ";
      
      /** 不进行事务处理的    update 方法*/
      public boolean updateProductTemporaryMaintainStatusSql(String status,String id) throws GSException{
          String tSql = this.updateProductTemporaryMaintainStatusSql;
          Object[] tobj = new Object[2];
          tobj[0] = status;
          tobj[1] = id;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public boolean insertProductBid(SampleElement vo) throws GSException{
    	  boolean flag=false;
          String tSql = this.insertProductBidSql;
          Object[] tobj = new Object[14];
          tobj[0] =vo.getChildElement("product_id").getTagValue()==null?"":vo.getChildElement("product_id").getTagValue().trim();
          tobj[1] =vo.getChildElement("product_code").getTagValue()==null?"":vo.getChildElement("product_code").getTagValue().trim();
          tobj[2] =vo.getChildElement("product_name").getTagValue()==null?"":vo.getChildElement("product_name").getTagValue().trim();
          tobj[3] =vo.getChildElement("remark").getTagValue()==null?"":vo.getChildElement("remark").getTagValue().trim();
          tobj[4] =vo.getChildElement("status").getTagValue()==null?"":vo.getChildElement("status").getTagValue().trim();
          tobj[5] =vo.getChildElement("product_type").getTagValue()==null?"":vo.getChildElement("product_type").getTagValue().trim();
          tobj[6] =vo.getChildElement("provider_code").getTagValue()==null?"":vo.getChildElement("provider_code").getTagValue().trim();
          tobj[7] =vo.getChildElement("create_time").getTagValue()==null?"":vo.getChildElement("create_time").getTagValue().trim();
          tobj[8] =vo.getChildElement("create_user").getTagValue()==null?"":vo.getChildElement("create_user").getTagValue().trim();
          tobj[9] =vo.getChildElement("create_user_id").getTagValue()==null?"":vo.getChildElement("create_user_id").getTagValue().trim();
          tobj[10] =vo.getChildElement("last_update_time").getTagValue()==null?"":vo.getChildElement("last_update_time").getTagValue().trim();
          tobj[11] =vo.getChildElement("last_update_user").getTagValue()==null?"":vo.getChildElement("last_update_user").getTagValue().trim();
          tobj[12] =vo.getChildElement("last_update_user_id").getTagValue()==null?"":vo.getChildElement("last_update_user_id").getTagValue().trim();
          tobj[13] =vo.getChildElement("id").getTagValue()==null?"":vo.getChildElement("id").getTagValue().trim();
          
          String tSql2 = this.updateProductSynConfigSql;
          Object[] tobj2 = new Object[3];
          tobj2[0] = tobj[13];
          tobj2[1] = tobj[10];
          tobj2[2] = "t_product_bid";
          try {
               flag=this.executeUpdate(tSql, tobj);
               if(flag){
            	  flag=this.executeUpdate(tSql2, tobj2);
               }
               return flag;
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public boolean insertProductType(SampleElement vo) throws GSException{
    	  boolean flag=false;
          String tSql = this.insertProductTypeSql;
          Object[] tobj = new Object[15];
          tobj[0] =vo.getChildElement("product_id").getTagValue()==null?"":vo.getChildElement("product_id").getTagValue().trim();
          tobj[1] =vo.getChildElement("product_code").getTagValue()==null?"":vo.getChildElement("product_code").getTagValue().trim();
          tobj[2] =vo.getChildElement("product_type").getTagValue()==null?"":vo.getChildElement("product_type").getTagValue().trim();
          tobj[3] =vo.getChildElement("provider_code").getTagValue()==null?"":vo.getChildElement("provider_code").getTagValue().trim();
          tobj[4] =vo.getChildElement("remark").getTagValue()==null?"":vo.getChildElement("remark").getTagValue().trim();
          tobj[5] =vo.getChildElement("create_time").getTagValue()==null?"":vo.getChildElement("create_time").getTagValue().trim();
          tobj[6] =vo.getChildElement("create_user").getTagValue()==null?"":vo.getChildElement("create_user").getTagValue().trim();
          tobj[7] =vo.getChildElement("create_user_id").getTagValue()==null?"":vo.getChildElement("create_user_id").getTagValue().trim();
          tobj[8] =vo.getChildElement("last_update_time").getTagValue()==null?"":vo.getChildElement("last_update_time").getTagValue().trim();
          tobj[9] =vo.getChildElement("last_update_user").getTagValue()==null?"":vo.getChildElement("last_update_user").getTagValue().trim();
          tobj[10] =vo.getChildElement("last_update_user_id").getTagValue()==null?"":vo.getChildElement("last_update_user_id").getTagValue().trim();
          tobj[11] =vo.getChildElement("is_bid").getTagValue()==null?"":vo.getChildElement("is_bid").getTagValue().trim();
          tobj[12] =vo.getChildElement("is_balance").getTagValue()==null?"":vo.getChildElement("is_balance").getTagValue().trim();
          tobj[13] =vo.getChildElement("status").getTagValue()==null?"":vo.getChildElement("status").getTagValue().trim();
          tobj[14] =vo.getChildElement("id").getTagValue()==null?"":vo.getChildElement("id").getTagValue().trim();
          
          String tSql2 = this.updateProductSynConfigSql;
          Object[] tobj2 = new Object[3];
          tobj2[0] = tobj[14];
          tobj2[1] = tobj[8];
          tobj2[2] = "t_product_type";
          try {
               flag=this.executeUpdate(tSql, tobj);
               if(flag){
            	  flag=this.executeUpdate(tSql2, tobj2);
               }
               return flag;
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public boolean insertProductTypeManager(SampleElement vo) throws GSException{
    	  boolean flag=false;
          String tSql = this.insertProductTypeManagerSql;
          Object[] tobj = new Object[13];
          tobj[0] =vo.getChildElement("product_type").getTagValue()==null?"":vo.getChildElement("product_type").getTagValue().trim();
          tobj[1] =vo.getChildElement("type_name").getTagValue()==null?"":vo.getChildElement("type_name").getTagValue().trim();
          tobj[2] =vo.getChildElement("remark").getTagValue()==null?"":vo.getChildElement("remark").getTagValue().trim();
          tobj[3] =vo.getChildElement("type_level").getTagValue()==null?"":vo.getChildElement("type_level").getTagValue().trim();
          tobj[4] =vo.getChildElement("upper_type").getTagValue()==null?"":vo.getChildElement("upper_type").getTagValue().trim();
          tobj[5] =vo.getChildElement("status").getTagValue()==null?"":vo.getChildElement("status").getTagValue().trim();
          tobj[6] =vo.getChildElement("create_user_id").getTagValue()==null?"":vo.getChildElement("create_user_id").getTagValue().trim();
          tobj[7] =vo.getChildElement("create_user").getTagValue()==null?"":vo.getChildElement("create_user").getTagValue().trim();
          tobj[8] =vo.getChildElement("create_time").getTagValue()==null?"":vo.getChildElement("create_time").getTagValue().trim();
          tobj[9] =vo.getChildElement("last_update_user_id").getTagValue()==null?"":vo.getChildElement("last_update_user_id").getTagValue().trim();
          tobj[10] =vo.getChildElement("last_update_user").getTagValue()==null?"":vo.getChildElement("last_update_user").getTagValue().trim();
          tobj[11] =vo.getChildElement("last_update_time").getTagValue()==null?"":vo.getChildElement("last_update_time").getTagValue().trim();
          tobj[12] =vo.getChildElement("id").getTagValue()==null?"":vo.getChildElement("id").getTagValue().trim();
          
          String tSql2 = this.updateProductSynConfigSql;
          Object[] tobj2 = new Object[3];
          tobj2[0] = tobj[12];
          tobj2[1] = tobj[11];
          tobj2[2] = "t_product_type_manager";
          try {
               flag=this.executeUpdate(tSql, tobj);
               if(flag){
            	  flag=this.executeUpdate(tSql2, tobj2);
               }
               return flag;
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      public boolean insertProductCategory(SampleElement vo) throws GSException{
    	  boolean flag=false;
          String tSql = this.insertProductCategorySql;
          Object[] tobj = new Object[21];
          tobj[0] =vo.getChildElement("code").getTagValue()==null?"":vo.getChildElement("code").getTagValue().trim();
          tobj[1] =vo.getChildElement("name").getTagValue()==null?"":vo.getChildElement("name").getTagValue().trim();
          tobj[2] =vo.getChildElement("remark").getTagValue()==null?"":vo.getChildElement("remark").getTagValue().trim();
          tobj[3] =vo.getChildElement("category_level").getTagValue()==null?"":vo.getChildElement("category_level").getTagValue().trim();
          tobj[4] =vo.getChildElement("upper_category").getTagValue()==null?"":vo.getChildElement("upper_category").getTagValue().trim();
          tobj[5] =vo.getChildElement("is_tradeflat_category").getTagValue()==null?"":vo.getChildElement("is_tradeflat_category").getTagValue().trim();
          tobj[6] =vo.getChildElement("category_id1").getTagValue()==null?"":vo.getChildElement("category_id1").getTagValue().trim();
          tobj[7] =vo.getChildElement("category_id2").getTagValue()==null?"":vo.getChildElement("category_id2").getTagValue().trim();
          tobj[8] =vo.getChildElement("status").getTagValue()==null?"":vo.getChildElement("status").getTagValue().trim();
          tobj[9] =vo.getChildElement("create_user_id").getTagValue()==null?"":vo.getChildElement("create_user_id").getTagValue().trim();
          tobj[10] =vo.getChildElement("create_user").getTagValue()==null?"":vo.getChildElement("create_user").getTagValue().trim();
          tobj[11] =vo.getChildElement("create_time").getTagValue()==null?"":vo.getChildElement("create_time").getTagValue().trim(); 
          tobj[12] =vo.getChildElement("last_update_user_id").getTagValue()==null?"":vo.getChildElement("last_update_user_id").getTagValue().trim();
          tobj[13] =vo.getChildElement("last_update_user").getTagValue()==null?"":vo.getChildElement("last_update_user").getTagValue().trim();
          tobj[14] =vo.getChildElement("last_update_time").getTagValue()==null?"":vo.getChildElement("last_update_time").getTagValue().trim();
          String lastNotifyTime =vo.getChildElement("last_notify_time").getTagValue()==null?"":vo.getChildElement("last_notify_time").getTagValue().trim();
          SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
          Date notifyTime=new Date();
   
              try {
            	  if(lastNotifyTime!=null&&!"".equals(lastNotifyTime)){
            		  notifyTime = format.parse(lastNotifyTime);
            		  tobj[15] = notifyTime.toLocaleString();
            	  }
			} catch (ParseException e1) {
				e1.printStackTrace();
			}
		  tobj[16] =vo.getChildElement("notify_times").getTagValue()==null?"":vo.getChildElement("notify_times").getTagValue().trim();
		  tobj[17] =vo.getChildElement("notify_result").getTagValue()==null?"":vo.getChildElement("notify_result").getTagValue().trim();
		  tobj[18] =vo.getChildElement("notify_update_times").getTagValue()==null?"":vo.getChildElement("notify_update_times").getTagValue().trim();
		  tobj[19] =vo.getChildElement("notify_update_result").getTagValue()==null?"":vo.getChildElement("notify_update_result").getTagValue().trim();
          tobj[20] =vo.getChildElement("id").getTagValue()==null?"":vo.getChildElement("id").getTagValue().trim();
          
          String tSql2 = this.updateProductSynConfigSql;
          Object[] tobj2 = new Object[3];
          tobj2[0] = tobj[20];
          tobj2[1] = tobj[14];
          tobj2[2] = "t_product_category";
          try {
               flag=this.executeUpdate(tSql, tobj);
               if(flag){
            	  flag=this.executeUpdate(tSql2, tobj2);
               }
               return flag;
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      
      //删除产品图片表对应记录
      public boolean delProductPicureByConcentricityCode(String concentricityCode)throws GSException{
  	    
	        String tSql="delete from t_product_picture where CONCENTRICITY_CODE=?";
	        Object[] tObj = {concentricityCode};
	   
	        boolean tResult = true;
	        try{
	            tResult = executeUpdate(tSql,tObj);
	        }catch(Exception ex){
	            GSLogWriter.error(this,ex.getMessage());
	            tResult = false;
	            throw new GSException(ex.getMessage());
	        }
	        return tResult;
	    }
      
      String insertProductPictureSql = "insert into t_product_picture (" +
      		"concentricity_code" +
      		") values (?)";
      
      /** 不进行事务处理的    insert方法*/
      public boolean insertProductPicture(String concentricityCode) throws GSException{
          String tSql = this.insertProductPictureSql;
          Object[] tobj = new Object[1];
          tobj[0] =concentricityCode;
          try {
              return this.executeUpdate(tSql, tobj);
          } catch (Exception e) {
              throw new GSException(GSException.E20042, GSException.E20042_MSG);
          }
      }
      /**
       * 查询产品信息
       * @param manufactureId         产品编码
       * @return                      产品数据对象
       * @throws GSException
       */
      public boolean getProductPictureByConcentricityCode(String concentricityCode) throws GSException { 
  		String tSql = "select * from t_product_picture where CONCENTRICITY_CODE = ?";
  		ArrayList tList = null;
  		Object[] tObj = {concentricityCode};
  		try{
  			tList = this.executeQuery(new GSProductPicture(),tSql,tObj);
  			if(tList!=null&&tList.size()>0){
  				return true;
  			}else{
  				return false;
  			}
  		}catch(Exception e){
  			GSLogWriter.error(this,e.toString());
  			throw new GSException(GSException.E19999,GSException.E19999_MSG);
  		}
      }
      
      public ArrayList getOrderDetailSignInByOrderDetailId(String detailId) throws GSException { 
  		String tSql = "select * from GS_ORDER_DETAIL_SIGNIN where GS_ORDER_DETAIL_ID = ?";
  		ArrayList tList = null;
  		GSOrderDetailSignIn tGSOrderDetailSignInBean = null;
  		Object[] tObj = {detailId};
  		try{
  			tList = this.executeQuery(new GSOrderDetailSignIn(),tSql,tObj);
  		}catch(Exception e){
  			GSLogWriter.error(this,e.toString());
  			throw new GSException(GSException.E19999,GSException.E19999_MSG);
  		}
  		
  		return tList;
      }
      
      
        
      
}
